Merge pull request #208 from navikt/feature/soknad-avroskjema-fra-ghb #714
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: Build, push, and deploy | |
on: | |
push: | |
branches: | |
- 'main' | |
paths-ignore: | |
- '**.md' | |
- '**/**.md' | |
permissions: | |
contents: "write" | |
id-token: "write" | |
jobs: | |
build-and-push: | |
name: Build and push Docker container | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
cache: 'maven' | |
- name: Build with maven | |
run: mvn install --file pom.xml | |
- name: Dependency submission (for dependabot) | |
uses: advanced-security/maven-dependency-submission-action@v4 | |
- name: Build and push Docker image | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: team-soknad | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
image_suffix: prod | |
byosbom: target/classes/META-INF/sbom/application.cdx.json | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
deploy-loadtests: | |
name: Deploy to loadtests | |
needs: build-and-push | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/nais.yml | |
VARS: .nais/config-loadtests.json | |
VAR: image=${{ needs.build-and-push.outputs.image }} | |
deploy-prod: | |
name: Deploy to prod | |
needs: build-and-push | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/nais.yml | |
VARS: .nais/config-prod.json | |
VAR: image=${{ needs.build-and-push.outputs.image }} | |
deploy-alerts-prod: | |
needs: deploy-prod | |
name: Deploy alerts to prod | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Deploy to alerts to prod | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/alerts.yml | |
VARS: .nais/prod-alert.json | |