-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.43 KB
/
Copy pathwiki.yml
File metadata and controls
53 lines (46 loc) · 1.43 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
name: Publish wiki
# Rebuilds the GitHub wiki from docs/ and wiki/ (scripts/build-wiki.mjs) and overwrites it.
# The wiki must exist first: create any page once in the GitHub UI.
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'wiki/**'
- 'CHANGELOG.md'
- 'CONTRIBUTING.md'
- 'package.json'
- 'scripts/build-wiki.mjs'
- '.github/workflows/wiki.yml'
workflow_dispatch:
concurrency:
group: wiki
cancel-in-progress: false
permissions:
contents: write
jobs:
wiki:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
- name: Build wiki pages
run: node scripts/build-wiki.mjs .wiki-build
- name: Push to the wiki repository
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone --depth 1 "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.wiki.git" .wiki-repo
cd .wiki-repo
find . -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
cp -R ../.wiki-build/. .
git add -A
if git diff --cached --quiet; then
echo "Wiki is up to date"
exit 0
fi
git -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \
commit -m "Sync wiki from ${GITHUB_SHA::7}"
git push origin HEAD