Konverterer til standalone og med cdn #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Denne filen vil erstatte build_prod, build_deploy_mock, etc. | ||
name: "Build and deploy to GCP" | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
jobs: | ||
deploy-gcp: | ||
strategy: | ||
matrix: | ||
include: | ||
- environment: preprod | ||
cluster: dev-gcp | ||
- environment: mock | ||
cluster: dev-gcp | ||
- environment: prod | ||
cluster: prod-gcp | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
env: | ||
NEXT_PUBLIC_DIGISOS_ENV: ${{ matrix.environment }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: 'Build npm project' | ||
uses: navikt/sosialhjelp-ci/actions/build-npm@main | ||
with: | ||
node-version: 20 | ||
build-less: 'false' | ||
reader-token: ${{ secrets.READER_TOKEN }} | ||
run-test: 'false' | ||
run-orval: 'true' | ||
- name: 'Upload static files to cdn' | ||
id: upload | ||
uses: nais/deploy/actions/cdn-upload/v2@master | ||
with: | ||
team: teamdigisos | ||
source: ./build/static | ||
destination: "/sosialhjelp-soknad/_next" | ||
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | ||
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | ||
- name: Build and push docker image to GAR | ||
uses: nais/docker-build-push@v0 | ||
id: docker-build-push | ||
with: | ||
team: teamdigisos | ||
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | ||
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | ||
image_suffix: ${{ matrix.environment }} | ||
build_args: | | ||
DIGISOS_ENV=${{ matrix.environment }} | ||
build_secrets: | | ||
NODE_AUTH_TOKEN=${{ secrets.READER_TOKEN }} | ||
- name: "Deploy to ${{ matrix.environment }}" | ||
uses: nais/deploy/actions/deploy@v2 | ||
env: | ||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
RESOURCE: .nais/app.yaml | ||
CLUSTER: ${{ matrix.cluster }} | ||
REF: ${{ github.sha }} | ||
PRINT_PAYLOAD: true | ||
IMAGE: ${{ steps.docker-build-push.outputs.image }} | ||
VARS: .nais/vars/${{ matrix.environment }}.yaml |