Created
July 13, 2024 21:08
-
-
Save kavicastelo/737df13f2e4cf91136fea164023b7390 to your computer and use it in GitHub Desktop.
angular and spring boot project, `build project` jobs workflow sample for both frontend and backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build-frontend: | |
if: contains(github.event.head_commit.message, '[run-all]') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Create environment directory | |
run: mkdir -p client/src/environments | |
- name: Setup environment variables for production | |
run: echo "${{ secrets.ENV_FILE_PROD_CONTENT }}" > client/src/environments/environment.ts | |
- name: Setup environment variables for development | |
run: echo "${{ secrets.ENV_FILE_DEV_CONTENT }}" > client/src/environments/environment.development.ts | |
- name: Install dependencies | |
run: | | |
cd client | |
npm install --force | |
- name: Build frontend | |
run: | | |
cd client | |
npm run build | |
build-backend: | |
if: contains(github.event.head_commit.message, '[run-all]') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Setup environment variables | |
run: echo "FAKE_ENV_VARIABLES" > .env | |
- name: Build backend | |
run: | | |
chmod +x ./mvnw | |
./mvnw clean package -DskipTests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment