fix: pom.xml to reduce vulnerabilities #854
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: Valintalaskentakoostepalvelu | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- '**.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- 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 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Europe/Helsinki" | |
- name: Build with Maven | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: mvn --settings settings.xml clean spotless:check verify -B -Dbranch=${GITHUB_REF_NAME} -Drevision=${GITHUB_SHA} -DbuildNumber=${GITHUB_RUN_NUMBER} | |
- uses: actions/cache@v2 | |
id: restore-build | |
with: | |
path: target | |
key: ${{ github.sha }} | |
deploy-container: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
id: restore-build | |
with: | |
path: 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 | |
export ARTIFACT_NAME="valintalaskentakoostepalvelu" | |
mv target/valintalaskentakoostepalvelu.jar $DOCKER_BUILD_DIR/artifact/${ARTIFACT_NAME}.jar | |
cp -vr src/main/resources/oph-configuration $DOCKER_BUILD_DIR/config/ | |
export BASE_IMAGE="baseimage-fatjar-openjdk17:master" | |
./ci-tools/common/pull-image.sh | |
./ci-tools/github-build/build-fatjar.sh $ARTIFACT_NAME | |
./ci-tools/github-build/upload-image.sh $ARTIFACT_NAME |