Skip to content

Saksbehandlervalg brevvelger (#964) #133

Saksbehandlervalg brevvelger (#964)

Saksbehandlervalg brevvelger (#964) #133

name: "deploy: skribenten-web"
'on':
push:
branches:
- main
paths:
- .github/workflows/deploy-skribenten-web.yaml
- skribenten-web/**
workflow_dispatch:
defaults:
run:
working-directory: skribenten-web
jobs:
build:
name: build
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: https://npm.pkg.github.com/
scope: '@navikt'
- name: Install frontend
working-directory: skribenten-web/frontend
run: npm install
- name: Build frontend
working-directory: skribenten-web/frontend
run: npm run build
- name: Copy frontend dist into public directory of bff
working-directory: skribenten-web/frontend
run: cp -r dist/ ../bff/public
- name: Install bff dependencies
working-directory: skribenten-web/bff
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Build bff
working-directory: skribenten-web/bff
run: npm run build
- name: Build and push Docker container
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: pensjonsbrev
image_suffix: web
docker_context: skribenten-web/bff
dockerfile: skribenten-web/bff/Dockerfile
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 app to dev
permissions:
contents: read
id-token: write
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to DEV
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: skribenten-web/bff/.nais/nais.yaml
VAR: image=${{needs.build.outputs.image}}
VARS: "skribenten-web/bff/.nais/bff-dev.yaml"
deploy-prod:
name: Deploy app to prod
permissions:
contents: read
id-token: write
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to PROD
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: skribenten-web/bff/.nais/nais.yaml
VAR: image=${{needs.build.outputs.image}}
VARS: "skribenten-web/bff/.nais/bff-prod.yaml"