Skip to content

Commit 4ddf321

Browse files
authored
Enable workflow dispatch for build deploy (#594)
Add workflow dispatch for build deploy
1 parent 90d90e7 commit 4ddf321

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

.github/workflows/build-deploy-app.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
on:
2+
workflow_dispatch:
3+
inputs:
4+
nais_environment:
5+
description: NAIS environment to deploy to
6+
type: choice
7+
options:
8+
- test
9+
- prod
10+
default: test
211
release:
312
types: [published]
413
push:
@@ -61,13 +70,20 @@ jobs:
6170
- name: Generate NAIS deploy variables
6271
id: nais-deploy-vars
6372
run: |
64-
if [[ ${{github.event_name}} == "release" ]]; then
65-
echo "cluster=prod" >> "$GITHUB_OUTPUT"
66-
echo "nais_config_path=.nais/prod.yaml" >> "$GITHUB_OUTPUT"
67-
else
68-
echo "cluster=test" >> "$GITHUB_OUTPUT"
69-
echo "nais_config_path=.nais/test.yaml" >> "$GITHUB_OUTPUT"
70-
fi
73+
case "${{ github.event_name }}" in
74+
release)
75+
nais_env="prod"
76+
;;
77+
workflow_dispatch)
78+
nais_env="${{ inputs.nais_environment }}"
79+
;;
80+
*)
81+
nais_env="test"
82+
;;
83+
esac
84+
85+
echo "cluster=${nais_env}" >> "$GITHUB_OUTPUT"
86+
echo "nais_config_path=.nais/${nais_env}.yaml" >> "$GITHUB_OUTPUT"
7187
7288
build-push-deploy:
7389
name: Build image, push to registries and deploy image

flake.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
flake-parts.lib.mkFlake {inherit inputs;} {
1111
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
1212
perSystem = {pkgs, ...}: {
13+
apps.actionlint = {
14+
type = "app";
15+
program = "${pkgs.actionlint}/bin/actionlint";
16+
};
17+
packages.actionlint = pkgs.actionlint;
1318
devShells.default = pkgs.mkShell {
1419
shellHook = ''
1520
export DAPLA_TEAM_API_URL=https://dapla-team-api.intern.test.ssb.no

0 commit comments

Comments
 (0)