Skip to content

Oppgrader ktlint til 1.3.1 #202

Oppgrader ktlint til 1.3.1

Oppgrader ktlint til 1.3.1 #202

Workflow file for this run

name: Build and deploy
on:
push:
branches-ignore:
- 'dependabot/**'
permissions:
contents: read
id-token: write
jobs:
build:
name: Build and publish Docker image
runs-on: ubuntu-latest
permissions: # Sjekk https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
contents: write
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/setup-gradle@v3
env:
# Eksluder test dependencies
DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS: compileClasspath|runtimeClasspath
with:
dependency-graph: generate-and-submit
- run: ./gradlew --configuration-cache build shadowJar
- name: docker-build-push
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: teamdagpenger
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 }}
deploy-dev:
name: Deploy to dev
needs: [ build ]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: dev-gcp
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: .nais/nais.yaml
VAR: image=${{ needs.build.outputs.image }}
VARS: .nais/dev-vars.yaml
PRINT_PAYLOAD: true
deploy-prod:
name: Deploy to Production
needs: [ build, deploy-dev ]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: prod-gcp
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: .nais/nais.yaml
VAR: image=${{ needs.build.outputs.image }}
VARS: .nais/prod-vars.yaml
PRINT_PAYLOAD: true