Oppdatere versjon katalog og shadow jar #87
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 and deploy | |
on: | |
push: | |
branches-ignore: | |
- 'dependabot/**' | |
paths-ignore: | |
- 'dp-inntekt-kontrakter/**' | |
jobs: | |
build: | |
permissions: | |
contents: "write" | |
id-token: "write" | |
name: Build and publish Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- uses: gradle/[email protected] | |
- uses: gradle/[email protected] | |
id: build | |
env: | |
DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS: compileClasspath|runtimeClasspath | |
ORG_GRADLE_PROJECT_githubUser: x-access-token | |
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
dependency-graph: generate-and-submit | |
arguments: --configuration-cache build | |
- uses: nais/docker-build-push@v0 | |
name: docker-build-push | |
id: docker-build-push | |
with: | |
team: teamdagpenger | |
tag: latest | |
push_image: true # optional, default true | |
dockerfile: Dockerfile # optional, default Dockerfile | |
docker_context: . # optional, default . | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
deploy-dev: | |
name: Deploy to dev | |
needs: [build] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
environment: dev-gcp | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: nais/dev/nais.yaml | |
VARS: nais/vars.yaml | |
VAR: image=${{ needs.build.outputs.image }} | |
PRINT_PAYLOAD: true | |
deploy-prod: | |
name: Deploy to Production | |
needs: [build, deploy-dev] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
environment: prod-gcp | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: prod-gcp | |
RESOURCE: nais/prod/nais.yaml | |
VARS: nais/vars.yaml | |
VAR: image=${{ needs.build.outputs.image }} | |
PRINT_PAYLOAD: true |