Skip to content

Commit

Permalink
updatert workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Majjki committed Apr 5, 2024
1 parent a2730ca commit 20748e6
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 40 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/bygg-og-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Bygg og deploy

on: [push, workflow_dispatch]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
IMAGE: ghcr.io/${{ github.repository }}/tiltak-stillingstitler:${{ github.sha }}

jobs:
build:
name: Bygg
permissions:
contents: read
id-token: write
packages: write
runs-on: ubuntu-latest
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Yarn install
run: yarn install
- 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
PRINT_PAYLOAD: true
VAR: image=${{ needs.build.outputs.image }}
deploy-prod:
name: Deploy til prod-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 prod-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: .nais/nais.yml
VARS: .nais/prod.yml
PRINT_PAYLOAD: true
VAR: image=${{ needs.build.outputs.image }}
40 changes: 0 additions & 40 deletions .github/workflows/deploy.yml

This file was deleted.

0 comments on commit 20748e6

Please sign in to comment.