Skip to content

Commit a21e52c

Browse files
committed
choose test or prod
1 parent 7ac211b commit a21e52c

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/publish_yak.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: publish_yak
22

3-
on: workflow_dispatch
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: "Choose deployment environment"
8+
required: true
9+
type: choice
10+
options:
11+
- test
12+
- prod
413

514
jobs:
615

@@ -9,6 +18,16 @@ jobs:
918

1019
steps:
1120

21+
- name: Set test flag based on input
22+
shell: pwsh
23+
run: |
24+
if ("${{ github.event.inputs.environment }}" -eq "test") {
25+
echo "TEST_FLAG=--test-server" | Out-File -FilePath $env:GITHUB_ENV -Append
26+
}
27+
else {
28+
echo "TEST_FLAG=" | Out-File -FilePath $env:GITHUB_ENV -Append
29+
}
30+
1231
- name: Checkout repo
1332
uses: actions/checkout@v4
1433

@@ -55,6 +74,6 @@ jobs:
5574
shell: pwsh
5675
run: |
5776
$file = Get-ChildItem -Path dist\yak_package\*rh8*.yak -File | Select-Object -ExpandProperty Name
58-
invoke publish-yak --test-server -y dist\yak_package\$file
77+
invoke publish-yak $Env:TEST_FLAG -y dist\yak_package\$file
5978
env:
6079
YAK_TOKEN: ${{ secrets.YAK_DF_TOKEN }}

0 commit comments

Comments
 (0)