GitHub Actions — preview deploy to Vercel
A CI workflow that builds with the Vercel CLI and posts a preview URL on every PR — no Vercel Git integration required.
ของ lazyyy เอง · อัปเดต 9 ส.ค. 2569
ส่วนประกอบ
PR preview deploys via GitHub Actions
Build once with vercel build, deploy the prebuilt output, and comment the URL.
name: Preview
on: pull_request
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm i -g vercel@latest
- run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
# ...deploy --prebuilt and post the URL (full YAML for members)
Full workflow (with the sticky PR comment + concurrency guard) included for members.