ARKIV-240 Config for Østfold #5
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
- name: Get repo name | |
id: get_repo | |
run: echo "REPO=${GITHUB_REPOSITORY#*/}" >> $GITHUB_OUTPUT | |
- name: Setup Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Gradle Setup | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: wrapper | |
- name: Gradle build | |
run: | | |
./gradlew build | |
mkdir data | |
cp ./build/libs/${GITHUB_REPOSITORY#*/}*.jar ./data/app.jar | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{steps.get_repo.outputs.REPO}} | |
path: ./data/app.jar | |
# - name: Trigger CD | |
# if: github.ref == 'refs/heads/main' | |
# uses: peter-evans/repository-dispatch@v2 | |
# with: | |
# token: ${{ secrets.GITHUBACTION_TOKEN }} | |
# repository: ${{ github.repository }} | |
# event-type: trigger-cd |