Skip to content

Merge branch 'master' into dependabot/npm_and_yarn/server/graphql-16.8.1 #58

Merge branch 'master' into dependabot/npm_and_yarn/server/graphql-16.8.1

Merge branch 'master' into dependabot/npm_and_yarn/server/graphql-16.8.1 #58

Workflow file for this run

name: CICD
on:
push:
workflow_dispatch:
jobs:
cicd:
name: CICD
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: https://npm.pkg.github.com/
cache: 'npm'
- name: Installer avhengigheter (client)
run: npm ci --omit=dev --omit=optional
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Installer avhengigheter (server)
run: npm ci --omit=dev --omit=optional
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
working-directory: ./server
- run: npm run lint
- run: npm run build
env:
PUBLIC_URL: https://cdn.nav.no/fager/min-side-arbeidsgiver/build/
- uses: nais/docker-build-push@v0
id: dockerpush
with:
team: fager
tag: ${{ github.sha }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
- id: upload
uses: navikt/frontend/actions/cdn-upload/v1@main
with:
cdn-team-name: fager
source: ./build/
destination: '/min-side-arbeidsgiver'
- name: Lag sentry release
continue-on-error: true
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
npx -p @sentry/cli sentry-cli releases new "${{ github.sha }}"
npx -p @sentry/cli sentry-cli releases files "${{ github.sha }}" upload-sourcemaps build/static/js \
--url-prefix '~/min-side-arbeidsgiver/static/js'
npx -p @sentry/cli sentry-cli releases set-commits --auto "${{ github.sha }}"
npx -p @sentry/cli sentry-cli releases finalize "${{ github.sha }}"
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v1
if: github.ref == 'refs/heads/master'
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
IMAGE: ${{ steps.dockerpush.outputs.image }}
CLUSTER: dev-gcp
RESOURCE: nais/dev-gcp.yaml
PRINT_PAYLOAD: true
VAR: commit=${{ github.sha }}
- name: Deploy til prod-gcp
uses: nais/deploy/actions/deploy@v1
if: github.ref == 'refs/heads/master'
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
IMAGE: ${{ steps.dockerpush.outputs.image }}
CLUSTER: prod-gcp
RESOURCE: nais/prod-gcp.yaml
PRINT_PAYLOAD: true
VAR: commit=${{ github.sha }}
- name: Deploy til labs-gcp
uses: nais/deploy/actions/deploy@v1
if: github.ref == 'refs/heads/master'
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
IMAGE: ${{ steps.dockerpush.outputs.image }}
CLUSTER: dev-gcp
RESOURCE: nais/labs-gcp.yaml
PRINT_PAYLOAD: true
VAR: commit=${{ github.sha }}
- name: Deploy til labs-gcp
if: github.ref == 'refs/heads/master'
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
IMAGE: ${{ steps.dockerpush.outputs.image }}
CLUSTER: dev-gcp
RESOURCE: nais/experimental-labs-gcp.yaml
PRINT_PAYLOAD: true
VAR: commit=${{ github.sha }}