Skip to content

Deploy 'chore/standalone' to 'mock' #626

Deploy 'chore/standalone' to 'mock'

Deploy 'chore/standalone' to 'mock' #626

name: "Build and deploy to mock-ekstern"
run-name: Deploy '${{ github.ref_name }}' to 'mock'
on:
workflow_dispatch:
env:
DOCKER_IMAGE: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}
NEXT_PUBLIC_DIGISOS_ENV: mock
jobs:
build-deploy:
name: "Build image and deploy"
runs-on: ubuntu-latest
outputs:
docker-tag: ${{ steps.docker-image.outputs.full-tag }}
permissions:
contents: write
packages: write
actions: write
env:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
WORKFLOW_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: 'Copy appropriate env file to root'
shell: bash
run: |
echo "Creating .env.production"
echo NEXT_PUBLIC_DIGISOS_ENV=mock >> .env.production
- 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: "Build Docker Image"
id: docker-image
uses: navikt/sosialhjelp-soknad/.github/actions/build-image@master
with:
prefix: ${{ env.NEXT_PUBLIC_DIGISOS_ENV }}
- 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 }}
- id: docker-image-tag
run: |
echo "IMAGE_TAG=${{ env.DOCKER_IMAGE }}:${{ steps.docker-image.outputs.full-tag }}" >> $GITHUB_ENV
- name: Deploy til ${{ env.NEXT_PUBLIC_DIGISOS_ENV }}
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
RESOURCE: .nais/app.yaml
VARS: .nais/vars/mock.yaml
CLUSTER: dev-gcp
REF: ${{ github.sha }}
PRINT_PAYLOAD: true
IMAGE: ${{ env.IMAGE_TAG }}