-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (88 loc) · 2.75 KB
/
docs.yml
File metadata and controls
106 lines (88 loc) · 2.75 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Docs
on:
pull_request:
branches:
- main
- dev
types: [opened, synchronize, reopened, ready_for_review]
paths:
- doc/**
- .github/actions/setup-node-pnpm/action.yml
- .github/workflows/ci.yml
- .github/workflows/docs.yml
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
- turbo.json
push:
branches:
- main
paths:
- doc/**
- .github/actions/setup-node-pnpm/action.yml
- .github/workflows/ci.yml
- .github/workflows/docs.yml
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
- turbo.json
workflow_dispatch:
permissions:
contents: read
concurrency:
group: docs-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docs-site-check:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-node-pnpm
with:
install-filter: "@truenine/memory-sync-docs..."
- name: Validate docs content
run: pnpm -C doc run validate:content
- name: Lint docs
run: pnpm -C doc run lint
- name: Typecheck docs
run: pnpm -C doc run check:type
- name: Build docs
run: cargo run -p xtask -- doc-build
deploy-docs:
needs: docs-site-check
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-node-pnpm
with:
install-filter: "@truenine/memory-sync-docs..."
- 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"