Bygg og deploy #13
Workflow file for this run
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
name: Bygg og deploy | |
on: | |
push: | |
branches: | |
- 'master' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Bygg | |
permissions: | |
contents: read | |
id-token: write | |
runs-on: ubuntu-latest | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
steps: | |
- name: Sjekk ut kode | |
uses: actions/checkout@v4 | |
- name: NPM install | |
run: npm ci | |
- name: Push docker image to GAR | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: arbeidsgiver | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
deploy-dev: | |
name: Deploy til dev-gcp | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Sjekk ut kode | |
uses: actions/checkout@v4 | |
- name: Deploy til dev-gcp | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/nais.yml | |
VARS: .nais/dev.yml | |
VAR: image=${{ needs.build.outputs.image }} | |
deploy-prod: | |
name: Deploy til prod-gcp | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Sjekk ut kode | |
uses: actions/checkout@v4 | |
- name: Deploy til prod-gcp | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/nais.yml | |
VARS: .nais/prod.yml | |
VAR: image=${{ needs.build.outputs.image }} |