tillater enkelte endringer selv om bruker ikke er under oppfølging (#… #216
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: Deploy application | |
on: | |
workflow_dispatch: # This workflow can be triggered manually from: https://github.com/navikt/amt-distribusjon/actions/workflows/deploy.yaml | |
push: | |
branches: | |
- main | |
env: | |
PRINT_PAYLOAD: true | |
jobs: | |
test-build-and-push: | |
permissions: | |
contents: "write" | |
id-token: "write" | |
security-events: "write" | |
name: Test, build and push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Setup Gradle to generate and submit dependency graphs | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
dependency-graph: generate-and-submit | |
- name: Build artifacts | |
run: ./gradlew build | |
- name: docker-build-push | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: amt | |
tag: ${{ github.sha }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
telemetry: ${{ steps.docker-build-push.outputs.telemetry }} | |
deploy-dev: | |
name: Deploy application to dev | |
needs: test-build-and-push | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: "write" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Deploy application | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/nais-dev.yaml | |
VAR: image=${{ needs.test-build-and-push.outputs.image }} | |
TELEMETRY: ${{ needs.test-build-and-push.outputs.telemetry }} | |
deploy-prod: | |
name: Deploy application to prod | |
needs: [ test-build-and-push, deploy-dev ] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: "write" | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Deploy application | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/nais-prod.yaml | |
VAR: image=${{ needs.test-build-and-push.outputs.image }} |