diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9f609f4b..ce3b5d8d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,37 +1,33 @@
-name: Viestinvalityspalvelu
-
+name: viestinvalityspalvelu
on:
workflow_dispatch:
+ release:
+ types: [ created ]
push:
paths-ignore:
- '**.md'
-
jobs:
- test-and-build:
+ build-and-deploy:
runs-on: ubuntu-latest
-
+ permissions:
+ contents: read
+ packages: write
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- - name: Cache local Maven repository
- uses: actions/cache@v2
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
-
- - name: Set up JDK 17
- uses: actions/setup-java@v2
+ - uses: actions/setup-java@v3
with:
java-version: '17'
- distribution: 'temurin'
+ distribution: 'corretto'
+ cache: 'maven'
- - uses: szenius/set-timezone@v1.0
- with:
- timezoneLinux: "Europe/Helsinki"
+ - name: Build
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: mvn clean package
- - name: Build with Maven
+ - name: Deploy
+ if: ${{ success() }}
env:
- GITHUB_TOKEN: ${{ github.token }}
- run: mvn clean verify -B -Dbranch=${GITHUB_REF_NAME} -Drevision=${GITHUB_SHA} -DbuildNumber=${GITHUB_RUN_NUMBER}
\ No newline at end of file
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: mvn deploy --batch-mode -DskipTests -pl kirjasto
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index e4ca3f03..61b2116e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,6 +93,14 @@
+
+
+ github
+ GitHub Packages
+ https://maven.pkg.github.com/Opetushallitus/viestinvalityspalvelu
+
+
+
github