refactor pipelines #3
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: Backend Build Stage | |
on: | |
push: | |
# paths: | |
# - backend/** | |
pull_request: | |
# paths: | |
# - backend/** | |
defaults: | |
run: | |
working-directory: ./backend | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .gradle | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
gradle-${{ runner.os }}- | |
- name: Clean Gradle environment | |
run: | | |
export GRADLE_USER_HOME=`pwd`/.gradle | |
./gradlew clean | |
- name: Build | |
run: ./gradlew assemble | |
# Specify artifacts to be saved from this job | |
# Adjust the path to match your project structure | |
# You can adjust the expiration time as needed | |
# Learn more: https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts | |
- name: Upload libs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libs | |
path: build/libs/*.jar |