Cleanup git dev #602
Workflow file for this run
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: Maven CI/CD | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'backend/**' | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Cache the Maven packages to speed up build | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Build project with Maven | |
run: cd backend && mvn -B package --file pom.xml | |
publish-job: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- run: cd backend && mvn -B package --file pom.xml -DskipTests | |
- run: cd backend && mkdir staging && cp target/*.jar staging | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Package | |
path: backend/staging |