Fiks snapshot #321
Workflow file for this run
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: modiapersonoversikt-api build, push, and deploy | |
on: | |
push: | |
paths-ignore: | |
- 'proxy/**' | |
concurrency: | |
group: web-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CI: true | |
TZ: Europe/Oslo | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
id-token: write | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
cache: 'maven' | |
- uses: nbadal/action-ktlint-setup@v1 | |
with: | |
ktlint_version: '1.3.1' | |
- name: Ktlint | |
run: bash ./linting.sh | |
- name: Build using maven | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mvn -P ci -B test --settings .github/maven-settings.xml | |
mvn -P ci -B package --settings .github/maven-settings.xml -DskipTests | |
- name: Publish Image | |
if: github.ref == 'refs/heads/master' | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: personoversikt | |
image_suffix: web | |
dockerfile: web/Dockerfile | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
deploy-dev: | |
name: Deploy to preprod | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
environment: dev-gcp | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
PRINT_PAYLOAD: true | |
CLUSTER: dev-gcp | |
RESOURCE: web/.nais/dev.yml | |
VAR: version=${{ github.sha }},image=${{ needs.build.outputs.image }} | |
deploy-prod: | |
name: Deploy to prod | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
environment: prod-gcp | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
PRINT_PAYLOAD: true | |
CLUSTER: prod-gcp | |
RESOURCE: web/.nais/prod.yml | |
VAR: version=${{ github.sha }},image=${{ needs.build.outputs.image }} |