Files
hideyoshi-blog/.github/workflows/deploy-preview.yml
Vitor Hideyoshi 57a4451e15
All checks were successful
Build and Test / run-test (20.x) (push) Successful in 33s
Vercel Preview Deployment / deploy (pull_request) Has been skipped
chore: add example environment file and update deployment workflows
2026-04-21 22:53:32 -03:00

44 lines
1.2 KiB
YAML

name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
id: deploy
run: echo "url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT
- name: Comment Preview URL on PR
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🔍 **Preview deployment ready!**\n\n${{ steps.deploy.outputs.url }}`
})