-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (46 loc) · 1.4 KB
/
deploy-doc.yml
File metadata and controls
59 lines (46 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Deploy Docs
on:
push:
branches:
- main
paths:
- doc/**
workflow_dispatch:
permissions:
contents: read
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
concurrency:
group: deploy-doc-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy-doc:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node-pnpm
- name: Preflight Vercel secrets
shell: bash
run: |
set -euo pipefail
if [[ -z "${VERCEL_TOKEN:-}" ]]; then
echo "::error::VERCEL_TOKEN is missing."
exit 1
fi
if [[ -z "${VERCEL_ORG_ID:-}" ]]; then
echo "::error::VERCEL_ORG_ID is missing."
exit 1
fi
if [[ -z "${VERCEL_PROJECT_ID:-}" ]]; then
echo "::error::VERCEL_PROJECT_ID is missing."
exit 1
fi
- name: Pull Vercel production settings
run: pnpm dlx vercel@latest pull --yes --environment=production --token="$VERCEL_TOKEN"
- name: Build docs on Vercel
run: pnpm dlx vercel@latest build --prod --token="$VERCEL_TOKEN"
- name: Deploy docs to Vercel production
run: pnpm dlx vercel@latest deploy --prebuilt --prod --token="$VERCEL_TOKEN"