Skip to content

OPHYK-208 add missing mvn settings file on deploy #13

OPHYK-208 add missing mvn settings file on deploy

OPHYK-208 add missing mvn settings file on deploy #13

name: oppijanumerorekisteri
on:
workflow_dispatch:
push:
branches: [master]
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "corretto"
cache: "maven"
- name: Maven version
run: ./mvnw --version
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw clean install -B -Dbranch=$GITHUB_REF_NAME -Drevision=$GITHUB_SHA -DbuildNumber=$GITHUB_RUN_NUMBER/$GITHUB_RUN_ATTEMPT org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Opetushallitus_oppijanumerorekisteri
- name: Upload jar
uses: actions/upload-artifact@v4
with:
name: oppijanumerorekisteri-jar
path: oppijanumerorekisteri-service/target/oppijanumerorekisteri-service-*SNAPSHOT.jar
deploy-container:
needs: [build]
uses: Opetushallitus/.github/.github/workflows/push-scan-java-ecr.yml@main
with:
application: oppijanumerorekisteri
base-image: baseimage-fatjar-openjdk21:master
configfolder: oppijanumerorekisteri-service/src/main/resources/config
jarfile: oppijanumerorekisteri-service-*SNAPSHOT
jarfolder: .
type: jar
download-artifact: true
download-artifact-name: oppijanumerorekisteri-jar
secrets:
AWS_UTILITY_ROLE_ARN: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }}
deploy-artifacts:
needs: [ build ]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'
- name: Maven version
run: ./mvnw --version
- name: Deploy
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
git clone https://github.com/Opetushallitus/ci-tools.git
source ci-tools/common/setup-tools.sh
./mvnw deploy -pl oppijanumerorekisteri-api -am -DskipTests --settings ci-tools/common/maven-settings.xml