Skip to content

Commit 151c3df

Browse files
committed
feat: Initial auto-deply for docs
1 parent b12400d commit 151c3df

File tree

3 files changed

+63
-15
lines changed

3 files changed

+63
-15
lines changed

.github/workflows/sync-docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# .github/workflows/sync-docs.yml
2+
name: Sync and Build Documentation
3+
4+
on:
5+
schedule:
6+
- cron: '0 6 * * *' # Daily at 6 AM UTC
7+
workflow_dispatch:
8+
repository_dispatch:
9+
types: [docs-updated] # Could be used as a on-push trigger, not sure
10+
11+
jobs:
12+
build-and-deploy:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout GitHub Pages repo
17+
uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Setup Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.9'
25+
26+
- name: Clone documentation repository
27+
run: |
28+
git clone https://github.com/multi-os-engine/doc.git temp-docs
29+
30+
- name: Install Sphinx and dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install sphinx sphinx-rtd-theme
34+
35+
- name: Build documentation
36+
run: |
37+
cd temp-docs
38+
make dirhtml
39+
cd ..
40+
41+
- name: Deploy docs
42+
run: |
43+
rm -rf docs/
44+
mkdir -p docs/
45+
cp -r temp-docs/build/dirhtml/* docs/
46+
47+
rm -rf temp-docs/
48+
49+
- name: Commit and push changes
50+
run: |
51+
git config --local user.email "[email protected]"
52+
git config --local user.name "GitHub Action"
53+
git add docs/
54+
if git diff --staged --quiet; then
55+
echo "No changes to commit"
56+
else
57+
git commit -m "Update documentation $(date '+%Y-%m-%d %H:%M:%S')"
58+
git push
59+
fi

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ include:
9898
- .htaccess
9999
- _pages
100100
- _blogposts
101+
- _downloads
102+
- _images
103+
- _sources
104+
- _static
101105
exclude:
102106
- "*.sublime-project"
103107
- "*.sublime-workspace"

_pages/docs.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)