Skip to content

Merge pull request #181 from navikt/feature/PEK-851-feature-toggle-fo… #54

Merge pull request #181 from navikt/feature/PEK-851-feature-toggle-fo…

Merge pull request #181 from navikt/feature/PEK-851-feature-toggle-fo… #54

Workflow file for this run

name: Deploy to Prod
on:
push:
branches: [main]
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
id-token: write
packages: write
steps:
# Checkout
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
# Build
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Build
run: ./gradlew clean build
env:
GITHUB_TOKEN: ${{ secrets.READER_TOKEN }}
# Release
- name: Build image
id: build-image
uses: nais/docker-build-push@v0
with:
dockerfile: Dockerfile
team: pensjonskalkulator
image_suffix: tps
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
tag: latest
outputs:
image: ${{ steps.build-image.outputs.image }}
deploy_prod:
name: Deploy to prod
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
name: Deploy to prod
env:
CLUSTER: prod-gcp
RESOURCE: .nais/nais-prod-gcp.yaml,unleash-apitoken-prod.yaml
IMAGE: ${{ needs.build.outputs.image }}