Skip to content

Merge pull request #3226 from navikt/amt-filter #4004

Merge pull request #3226 from navikt/amt-filter

Merge pull request #3226 from navikt/amt-filter #4004

name: CI/CD (mr-veileder-flate)
on:
push:
paths:
- .github/workflows/mr-veileder-flate.yaml
- package.json
- package-lock.json
- turbo.json
- frontend/mulighetsrommet-veileder-flate/**
- mulighetsrommet-api/src/main/resources/web/openapi.yaml
workflow_dispatch:
inputs:
environment:
type: choice
description: Environment
required: true
default: dev
options:
- dev
- dev_and_prod
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
TZ: Europe/Amsterdam
jobs:
ci:
name: CI
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.41.1-jammy
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Test
run: npx turbo run lint test:ci playwright --filter=mulighetsrommet-veileder-flate
deploy-demo:
name: Deploy (demo)
runs-on: ubuntu-latest
needs: [ci]
permissions:
id-token: "write" # Used to authenticate with Google Cloud
if: github.event_name == 'push' && github.ref_name == 'main' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Build
run: npx turbo run build:demo --filter=mulighetsrommet-veileder-flate
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/932652929200/locations/global/workloadIdentityPools/github/providers/github-action
service_account: [email protected]
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Upload files to GCS
run: gsutil -m rsync -r frontend/mulighetsrommet-veileder-flate/dist gs://mulighetsrommet-veileder-flate-demo
deploy-modia-dev:
name: Deploy (modia-dev)
runs-on: ubuntu-latest
needs: [ci]
permissions:
id-token: "write" # Used to authenticate with Google Cloud (through cdn-upload)
if: github.event_name == 'push' && github.ref_name == 'main' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Build
run: npx turbo run build:modia --filter=mulighetsrommet-veileder-flate -- --base=https://cdn.dev.nav.no/mulighetsrommet/arbeidsmarkedstiltak-modia/dist
env:
VITE_FARO_URL: https://telemetry.ekstern.dev.nav.no/collect
- name: Upload to NAV CDN
uses: navikt/frontend/actions/cdn-upload/v1@main
with:
cdn-environment: cdn.dev.nav.no
cdn-team-name: mulighetsrommet
source: frontend/mulighetsrommet-veileder-flate/dist
destination: arbeidsmarkedstiltak-modia
no-cache-paths: arbeidsmarkedstiltak-modia/dist/asset-manifest.json
deploy-modia-prod:
name: Deploy (modia-prod)
runs-on: ubuntu-latest
needs: [deploy-modia-dev]
permissions:
id-token: "write" # Used to authenticate with Google Cloud (through cdn-upload)
if: github.event_name == 'push' && github.ref_name == 'main' || github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'dev_and_prod'
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Build
run: npx turbo run build:modia --filter=mulighetsrommet-veileder-flate -- --base=https://cdn.nav.no/mulighetsrommet/arbeidsmarkedstiltak-modia/dist
env:
VITE_FARO_URL: https://telemetry.nav.no/collect
- name: Upload to NAV CDN
uses: navikt/frontend/actions/cdn-upload/v1@main
with:
cdn-environment: cdn.nav.no
cdn-team-name: mulighetsrommet
source: frontend/mulighetsrommet-veileder-flate/dist
destination: arbeidsmarkedstiltak-modia
no-cache-paths: arbeidsmarkedstiltak-modia/dist/asset-manifest.json
deploy-nav-dev:
name: Deploy (nav-dev)
runs-on: ubuntu-latest
needs: [ci]
permissions:
id-token: "write" # Used to authenticate with Google Cloud
if: github.event_name == 'push' && github.ref_name == 'main' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Build
run: npx turbo run build:nav --filter=mulighetsrommet-veileder-flate
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/932652929200/locations/global/workloadIdentityPools/github/providers/github-action
service_account: [email protected]
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Upload files to GCS
run: gsutil -m rsync -r frontend/mulighetsrommet-veileder-flate/dist gs://arbeidsmarkedstiltak-nav-dev
deploy-nav-prod:
name: Deploy (nav-prod)
runs-on: ubuntu-latest
needs: [deploy-nav-dev]
permissions:
id-token: "write" # Used to authenticate with Google Cloud
if: github.event_name == 'push' && github.ref_name == 'main' || github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'dev_and_prod'
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Build
run: npx turbo run build:nav --filter=mulighetsrommet-veileder-flate
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/380520190028/locations/global/workloadIdentityPools/github/providers/github-action
service_account: prod-deploy@team-mulighetsrommet-prod-5492.iam.gserviceaccount.com
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Upload files to GCS
run: gsutil -m rsync -r frontend/mulighetsrommet-veileder-flate/dist gs://arbeidsmarkedstiltak-nav-prod