Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Endret tillatelser

Endret tillatelser #8

Workflow file for this run

name: Deploy to prod-gcp
on:
push:
branches: [ main ]
env:
IMAGE: ghcr.io/${{ github.repository }}:${{ github.sha }}
jobs:
build:
name: Build and push docker container
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
id-token: write
environment: production
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Yarn install
run: yarn install
- name: Yarn build
run: yarn build
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Re-tag and publish image
run: |
docker build -t ${{ env.IMAGE }} .
docker push ${{ env.IMAGE }}
deploy:
name: Deploy to prod-gcp
needs: build
environment: production
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Deploy to prod
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: nais.yaml
IMAGE: ${{ env.IMAGE }}
PRINT_PAYLOAD: true