Skip to content

Merge pull request #40 from navikt/feature/saner-opphoer-av-forsoerge… #240

Merge pull request #40 from navikt/feature/saner-opphoer-av-forsoerge…

Merge pull request #40 from navikt/feature/saner-opphoer-av-forsoerge… #240

Workflow file for this run

name: Build and deploy
on: [push]
env:
IMAGE: ghcr.io/${{ github.repository }}:${{ github.sha }}
LATEST_IMAGE: ghcr.io/${{ github.repository }}:latest
jobs:
build:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- run: npm ci
- run: npm run build
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: .
push: true
pull: true
tags: ${{ env.IMAGE }},${{ env.LATEST_IMAGE }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
permissions:
contents: "read"
id-token: "write"
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: 'ubuntu-latest'
strategy:
matrix:
include:
- name: pensjon-bpc
cluster: prod-gcp
vars: .nais/vars-prod.yaml
- name: pensjon-bpc-q0
cluster: dev-gcp
vars: .nais/vars-dev-q0.yaml
- name: pensjon-bpc-q1
cluster: dev-gcp
vars: .nais/vars-dev-q1.yaml
- name: pensjon-bpc-q2
cluster: dev-gcp
vars: .nais/vars-dev-q2.yaml
- name: pensjon-bpc-q5
cluster: dev-gcp
vars: .nais/vars-dev-q5.yaml
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
name: 'Deploy to NAIS'
env:
RESOURCE: .nais/nais.yaml
CLUSTER: '${{ matrix.cluster }}'
VARS: ${{matrix.vars}}