Skip to content

Commit 998e309

Browse files
committed
Splitt deploy workflows, fiks permissions og kun deploy til prod fra main.
1 parent 395399a commit 998e309

File tree

3 files changed

+46
-12
lines changed

3 files changed

+46
-12
lines changed

.github/workflows/main.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ env:
2323
jobs:
2424
build:
2525
name: Build
26+
if: github.ref == 'refs/heads/main' # Only deploy to prod from main branch
2627
permissions:
2728
contents: read
28-
packages: write
2929
id-token: write
3030
uses: navikt/familie-baks-gha-workflows/.github/workflows/build-yarn-app.yaml@main
3131
with:

.github/workflows/manual-deploy.yaml .github/workflows/manual-deploy-dev.yaml

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
name: Manual deploy
1+
name: Manual deploy to dev
22
on:
33
workflow_dispatch:
44
inputs:
5-
environment:
6-
description: "Environment to deploy to"
7-
required: true
8-
type: choice
9-
options:
10-
- dev
11-
- prod
125
skip-tests:
136
description: 'Skip tests?'
147
default: false
@@ -26,7 +19,6 @@ jobs:
2619
name: Build
2720
permissions:
2821
contents: read
29-
packages: write
3022
id-token: write
3123
uses: navikt/familie-baks-gha-workflows/.github/workflows/build-yarn-app.yaml@main
3224
with:
@@ -44,6 +36,6 @@ jobs:
4436
uses: navikt/familie-baks-gha-workflows/.github/workflows/deploy.yaml@main
4537
with:
4638
image: ${{ needs.build.outputs.image }}
47-
cluster: ${{ inputs.environment }}-gcp
48-
resource: .nais/app-${{ inputs.environment }}.yaml
39+
cluster: dev-gcp
40+
resource: .nais/app-dev.yaml
4941
secrets: inherit
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Manual deploy to prod (from main)
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
skip-tests:
6+
description: 'Skip tests?'
7+
default: false
8+
type: boolean
9+
skip-validation:
10+
description: 'Skip validation? (eslint, prettier, typecheck)'
11+
default: false
12+
type: boolean
13+
14+
env:
15+
BASE_PATH: /barnetrygd/soknad/
16+
17+
jobs:
18+
build:
19+
name: Build
20+
if: github.ref == 'refs/heads/main' # Only deploy to prod from main branch
21+
permissions:
22+
contents: read
23+
id-token: write
24+
uses: navikt/familie-baks-gha-workflows/.github/workflows/build-yarn-app.yaml@main
25+
with:
26+
build-image: true
27+
push-image: true
28+
skip-tests: ${{ inputs.skip-tests }}
29+
skip-validation: ${{ inputs.skip-validation }}
30+
base-path: ${{ env.BASE_PATH }}
31+
secrets: inherit
32+
deploy-with-new-image:
33+
name: Deploy with new image
34+
permissions:
35+
id-token: write
36+
needs: [ build ]
37+
uses: navikt/familie-baks-gha-workflows/.github/workflows/deploy.yaml@main
38+
with:
39+
image: ${{ needs.build.outputs.image }}
40+
cluster: prod-gcp
41+
resource: .nais/app-prod.yaml
42+
secrets: inherit

0 commit comments

Comments
 (0)