mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-25 11:13:09 +00:00
Workflows nativos em .forgejo/workflows/ (ci, ci-pr, agent-pool, automerge, issue-transition, plan-issue, vercel-promote, archive), removendo .github/workflows e .github/actions. Runner Forgejo v13 com services Postgres por porta + DB_HOST via gateway do bridge. Libs de agente sobre o novo cliente forgejo-api.mjs (zero dependências, GITHUB_SERVER_URL/FORGEJO_API_URL), helpers de workflow plain-Node. pnpm issue corrigido (await em função sync) e validado ao vivo. Testes: forgejoApi.unit.spec.ts novo, pin do matrix do ci.yml atualizado. Closes #1 (parte 1 — docs/issues/pool seguem na parte 2)
69 lines
2.7 KiB
YAML
69 lines
2.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: ''
|
|
|
|
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: Install Vercel CLI
|
|
run: npm install --global vercel@55
|
|
- name: Promote to custom production domain
|
|
env:
|
|
DEPLOYMENT_REF: ${{ inputs.deployment }}
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -n "${DEPLOYMENT_REF:-}" ]; then
|
|
ref="$DEPLOYMENT_REF"
|
|
else
|
|
ref=$(node --input-type=module -e '
|
|
import { fetchLatestProductionReadyDeployment } from "./scripts/lib/vercel-production-alias.mjs";
|
|
const d = await fetchLatestProductionReadyDeployment({
|
|
token: process.env.VERCEL_TOKEN,
|
|
projectId: process.env.VERCEL_PROJECT_ID,
|
|
teamId: process.env.VERCEL_ORG_ID,
|
|
});
|
|
if (!d) {
|
|
console.error("no READY production deployment");
|
|
process.exit(1);
|
|
}
|
|
process.stdout.write(d.url ? `https://${d.url}` : d.id);
|
|
')
|
|
echo "Latest READY production: $ref"
|
|
fi
|
|
node scripts/vercel-ensure-production-alias.mjs "$ref"
|
|
# Docs: when Auto-assign is/was OFF, prefer `vercel promote` then `alias set`.
|
|
vercel promote "$ref" --token="$VERCEL_TOKEN" --scope="$VERCEL_ORG_ID" || true
|
|
# `--yes` is only valid for `alias rm`, not `alias set` (CLI 55).
|
|
vercel alias set "$ref" pt.jorgesolla.com.br --token="$VERCEL_TOKEN" --scope="$VERCEL_ORG_ID"
|