Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ jobs:
stage-app:
uses: ./.github/workflows/stage-vercel-deployment.yml
with:
target_environment: production
vercel_project_id_var: VERCEL_PROJECT_ID_APP
secrets: inherit

stage-global-app:
uses: ./.github/workflows/stage-vercel-deployment.yml
with:
target_environment: production
vercel_project_id_var: VERCEL_PROJECT_ID_GLOBAL_APP
secrets: inherit

Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy Web to Staging

on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: deploy-staging
cancel-in-progress: false
Comment thread
RSO marked this conversation as resolved.

jobs:
deploy-app:
uses: ./.github/workflows/stage-vercel-deployment.yml
with:
target_environment: staging
vercel_project_id_var: VERCEL_PROJECT_ID_APP
secrets: inherit

deploy-global-app:
uses: ./.github/workflows/stage-vercel-deployment.yml
with:
target_environment: staging
vercel_project_id_var: VERCEL_PROJECT_ID_GLOBAL_APP
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/redeploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ jobs:
needs: verify-main
uses: ./.github/workflows/stage-vercel-deployment.yml
with:
target_environment: production
vercel_project_id_var: VERCEL_PROJECT_ID_APP
secrets: inherit

stage-global-app:
needs: verify-main
uses: ./.github/workflows/stage-vercel-deployment.yml
with:
target_environment: production
vercel_project_id_var: VERCEL_PROJECT_ID_GLOBAL_APP
secrets: inherit

Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/stage-vercel-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Stage Vercel Deployment
on:
workflow_call:
inputs:
target_environment:
description: 'GitHub and Vercel environment to deploy to'
required: true
type: string
vercel_project_id_var:
description: 'Name of the GitHub variable containing the Vercel project ID to deploy'
required: true
Expand All @@ -19,12 +23,13 @@ jobs:
stage:
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 30
environment: production
environment: ${{ inputs.target_environment }}

outputs:
deployment_url: ${{ steps.deploy.outputs.deployment_url }}

env:
TARGET_ENVIRONMENT: ${{ inputs.target_environment }}
VERCEL_VERSION: '53.3.1'
VERCEL_ORG_ID: ${{ vars.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ vars[inputs.vercel_project_id_var] }}
Expand All @@ -41,7 +46,12 @@ jobs:
- name: Stage Vercel deployment
id: deploy
run: |
deployment_output=$(vercel deploy --prod --skip-domain --token=${{ secrets.VERCEL_TOKEN }})
if [ "$TARGET_ENVIRONMENT" = "production" ]; then
deployment_output=$(vercel deploy --prod --skip-domain --token=${{ secrets.VERCEL_TOKEN }})
else
deployment_output=$(vercel deploy --target="$TARGET_ENVIRONMENT" --token=${{ secrets.VERCEL_TOKEN }})
fi

deployment_url=$(printf '%s\n' "$deployment_output" | tail -n 1)
if [[ ! "$deployment_url" =~ ^https:// ]]; then
echo "Vercel deploy did not print a deployment URL" >&2
Expand Down