This commit is contained in:
1 parent
3681141394
commit
a97985633d
2 files changed
+41
No files matched your search
@@ -0,0 +1,37 @@
|
||||
# Deploy na Vercel pela Vercel CLI. Modelo generico: serve em qualquer repo sem edicao.
|
||||
# - Token: secret VERCEL_TOKEN de nivel de usuario no Gitea (vale para todos os repos).
|
||||
# - Projeto na Vercel = nome do repo; e criado na primeira execucao se nao existir.
|
||||
# - Branch padrao do repo -> producao; demais branches -> preview.
|
||||
# - Opcionais (Actions > Variables do repo): VERCEL_PROJECT (outro nome), NODE_VERSION (padrao 22).
|
||||
name: Deploy Vercel
|
||||
|
||||
"on":
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
||||
VERCEL_SCOPE: asemlk54-1928s-projects
|
||||
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ vars.NODE_VERSION || '22' }}
|
||||
# corepack respeita o "packageManager" do package.json (pnpm/yarn na versao certa)
|
||||
- run: npm install --global corepack@latest vercel@latest && corepack enable
|
||||
- name: Deploy
|
||||
run: |
|
||||
PROJECT=$(echo "${{ vars.VERCEL_PROJECT || github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')
|
||||
if [ "${{ github.ref_name }}" = "${{ github.event.repository.default_branch }}" ]; then
|
||||
ENV=production; PROD=--prod
|
||||
else
|
||||
ENV=preview; PROD=
|
||||
fi
|
||||
vercel link --yes --project "$PROJECT" --scope "$VERCEL_SCOPE" --token "$VERCEL_TOKEN"
|
||||
vercel pull --yes --environment=$ENV --token "$VERCEL_TOKEN"
|
||||
vercel build $PROD --token "$VERCEL_TOKEN"
|
||||
vercel deploy --prebuilt $PROD --token "$VERCEL_TOKEN"
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "https://openapi.vercel.sh/vercel.json",
|
||||
"framework": "nextjs"
|
||||
}
|
||||
Reference in new issue
Block a user