-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 2.2 KB
/
deploy.yml
File metadata and controls
77 lines (66 loc) · 2.2 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
# Deploy unified MPCP docs to https://mpcp-protocol.github.io/
# Site structure: / (landing) | /spec | /reference
#
# CRITICAL: Settings → Pages → Source: Deploy from a branch
# Branch: gh-pages | Folder: / (root)
# If you use "main", only the landing page will load (404 on /spec, /reference)
name: Deploy Docs
on:
push:
branches: [main]
workflow_dispatch:
repository_dispatch:
types: [deploy-docs]
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout org site
uses: actions/checkout@v4
- name: Checkout mpcp-spec
uses: actions/checkout@v4
with:
repository: mpcp-protocol/mpcp-spec
path: mpcp-spec
token: ${{ secrets.MPCP_DEPLOY_TOKEN }}
- name: Checkout mpcp-reference
uses: actions/checkout@v4
with:
repository: mpcp-protocol/mpcp-reference
path: mpcp-reference
token: ${{ secrets.MPCP_DEPLOY_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install MkDocs
run: pip install -r docs-requirements.txt
- name: Build spec
run: |
cd mpcp-spec
mkdocs build --config-file mkdocs.yml --strict
mv site ../_site_spec
- name: Build reference
run: |
cd mpcp-reference
mkdocs build --config-file mkdocs.unified.yml --strict
mv site ../_site_reference
- name: Assemble site
run: |
mkdir -p site
cp index.html site/
cp -r assets site/
cp -r _site_spec site/spec
cp -r _site_reference site/reference
touch site/.nojekyll
test -f site/spec/index.html || (echo "Missing site/spec/index.html" && exit 1)
test -f site/reference/index.html || (echo "Missing site/reference/index.html" && exit 1)
echo "Site structure OK"
find site -name index.html | head -20
- name: Deploy to GitHub Pages (gh-pages branch)
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site