Skip to content

Fjerner feature toggle: `OPPRETT_SAK_PÅ_RIKTIG_ENHET_OG_SAKSBEHANDLER… #3940

Fjerner feature toggle: `OPPRETT_SAK_PÅ_RIKTIG_ENHET_OG_SAKSBEHANDLER…

Fjerner feature toggle: `OPPRETT_SAK_PÅ_RIKTIG_ENHET_OG_SAKSBEHANDLER… #3940

name: Build-Deploy-Prod-GCP
on:
push:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
bygg:
name: Bygg app/image, push til github, deploy til preprod-gcp
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Bygg med maven
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -Dhttp.keepAlive=false -Dmaven.test.skip=true -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -B --no-transfer-progress package --settings .m2/maven-settings.xml --file pom.xml
- uses: nais/docker-build-push@v0
id: docker-push
with:
team: teamfamilie
tag: latest
push_image: true
dockerfile: Dockerfile
docker_context: .
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
byosbom: target/classes/META-INF/sbom/application.cdx.json
- name: Skriv ut docker-taggen
run: echo 'Docker-tag er ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} ' >> $GITHUB_STEP_SUMMARY
outputs:
image: ${{ steps.docker-push.outputs.image }}
deploy-preprod:
name: Deploy til dev-gcp
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
needs: [ bygg ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.GITHUB_ACCESS_TOKEN }}
CLUSTER: dev-gcp
RESOURCE: .deploy/nais/app-preprod.yaml
VAR: image=${{ needs.bygg.outputs.image }}
deploy-to-prod:
name: Deploy til prod-gcp
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
needs: [ bygg, deploy-preprod ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy til prod-gcp
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.GITHUB_ACCESS_TOKEN }}
CLUSTER: prod-gcp
RESOURCE: .deploy/nais/app-prod.yaml
IMAGE: ${{ needs.bygg.outputs.image }}
loggfeil:
name: Send logg til slack ved feil
runs-on: ubuntu-latest
needs: [deploy-to-prod]
if: failure()
steps:
- name: Send logg til slack ved feil
run: |
curl -X POST --data "{\"text\": \"Deploy av $GITHUB_REPOSITORY feilet - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}" $WEBHOOK_URL
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}