teqo-backup/.github/workflows/vercel-promote.yml
Cursor Agent baa8f14f82
fix(ci): promote Vercel deploy to pt.jorgesolla.com.br
Disabling Git auto-deploy is correct for Actions-gated production. The
separate project toggle "Auto-assign Custom Production Domains" must stay
ON — when OFF, `vercel deploy --prod` only aliases *.vercel.app and leaves
the custom domain on an older Current (exactly what we saw after #122).

After each deploy, ensure-production-alias re-enables auto-assign if needed,
promotes the deployment, and verifies pt.jorgesolla.com.br is attached.
Also adds workflow_dispatch "Vercel promote production" for promote-without-rebuild.
2026-08-01 15:26:31 +00:00

52 lines
1.7 KiB
YAML

# Promote a READY production deployment to custom domains (no rebuild).
# Use when `vercel deploy --prod` staged a deployment but left pt.jorgesolla.com.br
# on an older Current (Auto-assign Custom Production Domains OFF).
name: Vercel promote production
on:
workflow_dispatch:
inputs:
deployment:
description: 'Deployment URL or id (empty = latest READY production)'
required: false
type: string
default: ''
permissions:
contents: read
jobs:
promote:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 24
package-manager-cache: false
- name: Require Vercel credentials
run: |
set -euo pipefail
missing=()
[ -z "${VERCEL_TOKEN:-}" ] && missing+=(VERCEL_TOKEN)
[ -z "${VERCEL_ORG_ID:-}" ] && missing+=(VERCEL_ORG_ID)
[ -z "${VERCEL_PROJECT_ID:-}" ] && missing+=(VERCEL_PROJECT_ID)
if [ "${#missing[@]}" -gt 0 ]; then
echo "::error::Missing secrets: ${missing[*]}"
exit 1
fi
- name: Promote to custom production domain
env:
DEPLOYMENT_REF: ${{ inputs.deployment }}
run: |
set -euo pipefail
if [ -n "${DEPLOYMENT_REF:-}" ]; then
node scripts/vercel-ensure-production-alias.mjs "$DEPLOYMENT_REF"
else
node scripts/vercel-ensure-production-alias.mjs --latest
fi