Skip to content

Fiks server error som kom pga logging til amplitude #200

Fiks server error som kom pga logging til amplitude

Fiks server error som kom pga logging til amplitude #200

Workflow file for this run

name: Auto-deploy to NAIS (PROD)
on:
push:
branches:
- main
env:
docker_image: ghcr.io/${{ github.repository }}:${{ github.sha }}
jobs:
build-prod:
name: Build and push Prod Docker container
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
env:
BUILD_ENV: prod
IMAGE_PROXY_URL: https://finnhjelpemiddel.nav.no/imageproxy
CDN_URL: https://cdn.nav.no/teamdigihot/grunndata/media/v1/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install npm dependencies
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
run: npm install
- name: Build application
run: npm run build
- name: Upload static files to NAV CDN
uses: navikt/frontend/actions/cdn-upload/v1@main
with:
cdn-team-name: teamdigihot
source: ./.next/static
destination: '/hm-oversikt-frontend/prod/_next'
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.docker_image }}
build-args: |
BUILD_ENV=${{ env.BUILD_ENV }}
IMAGE_PROXY_URL=${{ env.IMAGE_PROXY_URL }}
CDN_URL=${{ env.CDN_URL }}
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
"NODE_AUTH_TOKEN=${{ secrets.READER_TOKEN }}"
deploy-to-prod:
name: Deploy to NAIS (PROD)
needs: build-prod
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .nais/nais-prod.yaml,.nais/unleash-apitoken.yaml
VAR: image=${{ env.docker_image }}