-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (37 loc) · 1.23 KB
/
build-docs.yml
File metadata and controls
43 lines (37 loc) · 1.23 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
name: Build Docs
on:
repository_dispatch:
types: [docs-updated]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Fetch latest docs from source repo
run: |
git clone --depth 1 --branch main \
https://github.com/ravindu644/Droidspaces-OSS.git /tmp/source
rm -rf docs/content/
mkdir -p docs/content
cp -r /tmp/source/Documentation/. docs/content/
- name: Build HTML
run: python3 .github/scripts/build-docs.py
- name: Clean up source markdown
run: rm -rf docs/content/
- name: Commit and push
run: |
SHA="${{ github.event.client_payload.sha }}"
if [ -z "$SHA" ]; then
SHA=$(git -C /tmp/source rev-parse HEAD)
fi
git config user.name "docs-bot"
git config user.email "bot@droidspaces.org"
git remote set-url origin \
https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git
git add -A
git diff --cached --quiet || \
git commit -m "docs: update from source@${SHA:0:7}" && \
git push