45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Deploy preview to vercel
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
|
|
jobs:
|
|
deploy:
|
|
name: Deploy preview
|
|
if: ${{ github.repository == 'dot013/.www-new' }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [20]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v3
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'pnpm'
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.22.2'
|
|
- name: Build
|
|
run: |
|
|
pnpm install
|
|
go install github.com/a-h/templ/cmd/templ@latest
|
|
make build-vercel
|
|
- name: Deploy
|
|
uses: amondnet/vercel-action@v25
|
|
with:
|
|
vercel-token: ${{ secrets.VERCEL_TOKEN }}
|
|
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
|
|
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|