Skip to content

Deploy Staging

Deploy Staging #15

# Runs after CI passes on main → staging deploy.
# Gated on the CLOUDFLARE_PAGES_PROJECT repo variable: skipped in repos without staging.
name: Deploy Staging
on:
workflow_run:
workflows: ["CI"]
branches: [main]
types: [completed]
concurrency:
group: deploy-staging
cancel-in-progress: false
jobs:
deploy:
if: github.event.workflow_run.conclusion == 'success' && vars.CLOUDFLARE_PAGES_PROJECT != ''
runs-on: ubuntu-24.04
timeout-minutes: 15
environment: staging
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '22'
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build:staging
env:
VITE_APP_VERSION: ${{ github.sha }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name ${{ vars.CLOUDFLARE_PAGES_PROJECT }} --branch=main
- name: Notify Slack
if: always()
uses: ./.github/actions/notify-deploy
with:
slack-webhook: ${{ secrets.SLACK_DEPLOY_WEBHOOK }}
status: ${{ job.status }}
environment: staging