Skip to content

Commit

Permalink
feat. Kun en workflow for deploy til både dev og prod (#1232)
Browse files Browse the repository at this point in the history
* feat. Kun en workflow for deploy til både dev og prod

* Update .github/workflows/bygg-og-deploy.yml

Co-authored-by: Odd A <[email protected]>

---------

Co-authored-by: Odd A <[email protected]>
  • Loading branch information
eirikv and Oddsor authored Aug 13, 2024
1 parent 50aca1d commit efba6e3
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 150 deletions.
145 changes: 0 additions & 145 deletions .github/workflows/bygg-og-deploy-master.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Bygg og deploy branch
name: Bygg og deploy

on: workflow_dispatch
on:
workflow_dispatch:
push:
branches:
- 'master'

jobs:
build:
Expand Down Expand Up @@ -40,7 +44,7 @@ jobs:
run: npm run build
- name: Sentry release
run: npm run release
- name: Remove source maps
- name: Fjerne source maps
run: |
rm dist/client/assets/*.map
- name: Push docker image to GAR
Expand Down Expand Up @@ -68,7 +72,7 @@ jobs:
RESOURCE: nais/nais-gcp-intern.yaml
VARS: nais/dev-gcp-intern.yaml
VAR: image=${{ needs.build.outputs.image }}

deploy-dev-gcp-ekstern:
name: Deploy til dev-gcp ekstern
runs-on: ubuntu-latest
Expand All @@ -86,7 +90,7 @@ jobs:
RESOURCE: nais/nais-gcp-ekstern.yaml
VARS: nais/dev-gcp-ekstern.yaml
VAR: image=${{ needs.build.outputs.image }}

deploy-dev-gcp-labs:
name: Deploy til dev-gcp (labs)
runs-on: ubuntu-latest
Expand All @@ -104,3 +108,41 @@ jobs:
RESOURCE: nais/dev-gcp-labs.yaml
VARS: nais/dev-gcp-labs.json
VAR: image=${{ needs.build.outputs.image }}

deploy-prod-gcp-intern:
name: Deploy til prod-gcp intern
if: github.ref == 'refs/heads/master'
needs: [build, deploy-dev-gcp-intern, deploy-dev-gcp-ekstern, deploy-dev-gcp-labs]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Deploy til prod-gcp intern
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: nais/nais-gcp-intern.yaml
VARS: nais/prod-gcp-intern.yaml
VAR: image=${{ needs.build.outputs.image }}

deploy-prod-gcp-ekstern:
name: Deploy til prod-gcp ekstern
if: github.ref == 'refs/heads/master'
needs: [build, deploy-dev-gcp-intern, deploy-dev-gcp-ekstern, deploy-dev-gcp-labs]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Deploy til prod-gcp ekstern
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: nais/nais-gcp-ekstern.yaml
VARS: nais/prod-gcp-ekstern.yaml
VAR: image=${{ needs.build.outputs.image }}

0 comments on commit efba6e3

Please sign in to comment.