Skip to content

Commit 52aee55

Browse files
rajbosCopilot
andcommitted
feat: add deploy_to_test workflow_dispatch input
Adds a boolean deploy_to_test input to the workflow_dispatch trigger. When set to true, a manual run from the main branch will route to the testing environment instead of production (same slug/hash logic as branch-based deployments). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 43f43c2 commit 52aee55

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)