Skip to content

Commit b8e05a8

Browse files
authored
Merge pull request #698 from rajbos/rajbos/add-deploy-to-test-dispatch
feat: add deploy_to_test workflow_dispatch input
2 parents 43f43c2 + 52aee55 commit b8e05a8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/sharing-server-deploy.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
- "sharing-server/**"
1111
- ".github/workflows/sharing-server-deploy.yml"
1212
workflow_dispatch:
13+
inputs:
14+
deploy_to_test:
15+
description: 'Deploy main branch to the test environment instead of production'
16+
type: boolean
17+
default: false
1318

1419
# One deploy per branch at a time — prevents concurrent Terraform runs from
1520
# conflicting on the same remote state file (state blob already locked errors).
@@ -42,8 +47,10 @@ jobs:
4247

4348
- name: Compute deployment parameters
4449
id: env
50+
env:
51+
FORCE_TEST: ${{ inputs.deploy_to_test }}
4552
run: |
46-
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
53+
if [[ "${{ github.ref }}" == "refs/heads/main" && "$FORCE_TEST" != "true" ]]; then
4754
{
4855
echo "app_name=sharing-server-prod"
4956
echo "state_key=sharing-server/prod.tfstate"

0 commit comments

Comments
 (0)