Skip to content

Deploy 'master' to 'mock' #638

Deploy 'master' to 'mock'

Deploy 'master' to 'mock' #638

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-image:
name: "Build Artifact and Image"
runs-on: ubuntu-latest
outputs:
docker-tag: ${{ steps.docker-image.outputs.full-tag }}
artifact-version: ${{ steps.docker-image.outputs.artifact-version }}
permissions:
contents: write
packages: write
actions: write
env:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
WORKFLOW_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Build Docker Image"
id: docker-image
uses: navikt/sosialhjelp-soknad/.github/actions/build-image@master
with:
prefix: ${{ env.NEXT_PUBLIC_DIGISOS_ENV }}
deploy-app:
name: "Deploy Application"
runs-on: ubuntu-latest
needs: build-image
permissions:
packages: write
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- id: docker-image-tag
run: |
echo "IMAGE_TAG=${{ env.DOCKER_IMAGE }}:${{ needs.build-image.outputs.docker-tag }}" >> $GITHUB_ENV
- name: Deploy til ${{ env.NEXT_PUBLIC_DIGISOS_ENV }}
uses: nais/deploy/actions/deploy@v2
env:
RESOURCE: .nais/app.yaml
VARS: .nais/vars/mock.yaml
CLUSTER: dev-gcp
REF: ${{ github.sha }}
PRINT_PAYLOAD: true
IMAGE: ${{ env.IMAGE_TAG }}