-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.14 KB
/
deploy.yml
File metadata and controls
87 lines (71 loc) · 2.14 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
name: Deploy Registry
on:
push:
branches:
- main
paths:
- 'fragments/**'
- 'package.json'
- 'src/registry/**'
- 'docs/**'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Restore existing registry
run: |
if git ls-remote --exit-code --heads origin gh-pages; then
git clone --branch gh-pages --depth 1 https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git .gh-pages
else
echo "gh-pages branch not found, starting fresh."
fi
- name: Merge registry content
run: |
if [ -d .gh-pages ]; then
mkdir -p registry
# Copy everything except .git to registry folder
rsync -av --exclude='.git' .gh-pages/ registry/
fi
- name: Build Registry
run: npm run build:registry
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install MkDocs
run: pip install mkdocs-material
- name: Build Docs
run: mkdocs build -d site
- name: Merge Docs to Registry
run: cp -r site/* registry/
- name: Sync back to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./registry
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Update registry content'
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './registry'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4