Merge pull request #596 from Opetushallitus/OK-415 #856
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: Suoritusrekisteri | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- '**.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
java-version-file: '.java-version' | |
distribution: 'corretto' | |
cache: 'maven' | |
- name: Install Chrome | |
uses: browser-actions/setup-chrome@latest | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
cache-dependency-path: suoritusrekisteri/package-lock.json | |
- name: Run NPM | |
run: | | |
npm install bower | |
node_modules/bower/bin/bower update | |
npm -v | |
node -v | |
- uses: MathRobin/[email protected] | |
with: | |
timezoneLinux: "Europe/Helsinki" | |
- name: Build with Maven | |
run: | | |
chrome --version | |
mvn clean spotless:check install -B -DargLine="-Dlog4j.configuration=file:./src/test/resources/log4j.properties" | |
- uses: actions/cache@v4 | |
id: restore-build | |
with: | |
path: | | |
suoritusrekisteri/target | |
ovara-suoritusrekisteri/target | |
key: ${{ github.sha }} | |
deploy-container: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
id: restore-build | |
with: | |
path: | | |
suoritusrekisteri/target | |
ovara-suoritusrekisteri/target | |
key: ${{ github.sha }} | |
- name: Build Docker container | |
shell: bash | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: | | |
git clone https://github.com/Opetushallitus/ci-tools.git | |
source ci-tools/common/setup-tools.sh | |
mv suoritusrekisteri/target/suoritusrekisteri*allinone.jar $DOCKER_BUILD_DIR/artifact/suoritusrekisteri.jar | |
jar xf $DOCKER_BUILD_DIR/artifact/suoritusrekisteri.jar META-INF/native | |
mv META-INF/native $DOCKER_BUILD_DIR/native_libs | |
cp -vr suoritusrekisteri/src/main/resources/* $DOCKER_BUILD_DIR/config/ | |
export BASE_IMAGE="baseimage-fatjar-openjdk11:master" | |
./ci-tools/common/pull-image.sh | |
./ci-tools/github-build/build-fatjar.sh suoritusrekisteri | |
./ci-tools/github-build/upload-image.sh suoritusrekisteri | |
./ci-tools/common/clean-docker-build-dir.sh | |
mv ovara-suoritusrekisteri/target/ovara-suoritusrekisteri*jar-with-dependencies.jar $DOCKER_BUILD_DIR/artifact/ovara-suoritusrekisteri.jar | |
jar xf $DOCKER_BUILD_DIR/artifact/ovara-suoritusrekisteri.jar META-INF/native | |
mv META-INF/native $DOCKER_BUILD_DIR/native_libs | |
cp -vr ovara-suoritusrekisteri/src/main/resources/* $DOCKER_BUILD_DIR/config/ | |
export BASE_IMAGE="baseimage-fatjar-openjdk11:master" | |
./ci-tools/common/pull-image.sh | |
./ci-tools/github-build/build-fatjar.sh ovara-suoritusrekisteri | |
./ci-tools/github-build/upload-image.sh ovara-suoritusrekisteri |