Skip to content

Commit 3956b2b

Browse files
committed
add 2nd CI. doesn't work yet.
1 parent 8dc101b commit 3956b2b

File tree

2 files changed

+110
-54
lines changed

2 files changed

+110
-54
lines changed
Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build docs, publish gh-pages, upload ZIP
1+
name: Build docs and upload ZIP
22

33
on:
44
push:
@@ -21,22 +21,14 @@ jobs:
2121
- name: Checkout current branch
2222
uses: actions/checkout@v4
2323

24-
# # 2. Checkout gh-pages branch
25-
# - name: Checkout gh-pages
26-
# uses: actions/checkout@v4
27-
# with:
28-
# ref: gh-pages
29-
# fetch-depth: 0
30-
# path: gh-pages
31-
32-
# 3. Java 8
24+
# 2. Java 8
3325
- name: Set up Java 8
3426
uses: actions/setup-java@v4
3527
with:
3628
distribution: temurin
3729
java-version: "8"
3830

39-
# 4. Python 3.10.19 + MkDocs + plugins
31+
# 3. Python 3.10.19 + MkDocs + plugins
4032
- name: Set up Python 3.10.19
4133
uses: actions/setup-python@v5
4234
with:
@@ -51,14 +43,13 @@ jobs:
5143
mkdocs-awesome-pages-plugin \
5244
mkdocs-macros-plugin
5345
54-
# 5. Build docs via build-doc.sh
46+
# 4. Build docs via build-doc.sh
5547
- name: Build documentation
5648
run: |
5749
chmod +x ./build-doc.sh
5850
./build-doc.sh
5951
60-
# 6. Upload built docs as a ZIP artifact
61-
# mkdocs.yml -> site_dir: docs, so output is doc/docs/
52+
# 5. Upload built docs as a ZIP artifact
6253
- name: Archive built documentation
6354
run: |
6455
zip -r docs-built.zip docs
@@ -68,43 +59,4 @@ jobs:
6859
with:
6960
name: built-docs-zip
7061
path: docs-built.zip
71-
retention-days: 10
72-
73-
# 7. Replace content in gh-pages branch
74-
# - name: Sync docs into gh-pages
75-
# run: |
76-
# cd gh-pages
77-
# find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
78-
# cd ..
79-
# cp -R doc/docs/* gh-pages/
80-
#
81-
# # 8. Commit changes to gh-pages
82-
# - name: Commit and push to gh-pages
83-
# working-directory: gh-pages
84-
# run: |
85-
# git config user.name "github-actions[bot]"
86-
# git config user.email "github-actions[bot]@users.noreply.github.com"
87-
#
88-
# git add .
89-
#
90-
# if git diff --cached --quiet; then
91-
# echo "No changes to push to gh-pages."
92-
# exit 0
93-
# fi
94-
#
95-
# git commit -m "Update generated docs"
96-
# git push origin gh-pages
97-
#
98-
# # 9. Create or update PR: gh-pages-pr -> gh-pages
99-
# - name: Create or update gh-pages PR
100-
# uses: peter-evans/create-pull-request@v7
101-
# with:
102-
# token: ${{ secrets.GITHUB_TOKEN }}
103-
# path: gh-pages
104-
# branch: gh-pages-pr
105-
# base: gh-pages
106-
# commit-message: "Update generated docs"
107-
# title: "Update generated docs on gh-pages"
108-
# body: |
109-
# This PR updates the `gh-pages` branch with the latest generated documentation.
110-
# A downloadable ZIP of the built docs is also available in the workflow artifacts.
62+
retention-days: 10
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Update gh-pages-staging on commit
2+
3+
on:
4+
push:
5+
branches:
6+
- 4.x
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-docs:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
# 1. Checkout doc branch
17+
- name: Checkout current branch
18+
uses: actions/checkout@v4
19+
20+
# 2. Java 8
21+
- name: Set up Java 8
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: temurin
25+
java-version: "8"
26+
27+
# 3. Python 3.10.19 + MkDocs + plugins
28+
- name: Set up Python 3.10.19
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.10.19"
32+
33+
- name: Install MkDocs dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install \
37+
mkdocs \
38+
mkdocs-material \
39+
mkdocs-awesome-pages-plugin \
40+
mkdocs-macros-plugin
41+
42+
# 4. Build docs via build-doc.sh
43+
- name: Build documentation
44+
run: |
45+
chmod +x ./build-doc.sh
46+
./build-doc.sh
47+
48+
# 5. Upload built docs as a ZIP artifact
49+
- name: Archive built documentation
50+
run: |
51+
zip -r docs-built.zip docs
52+
53+
- name: Upload built doc artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: built-docs-zip
57+
path: docs-built.zip
58+
retention-days: 10
59+
60+
# 6. Checkout gh-pages-staging branch
61+
- name: Checkout gh-pages-staging
62+
uses: actions/checkout@v4
63+
with:
64+
ref: gh-pages-staging
65+
path: gh-pages-staging
66+
67+
# 7. Replace content in gh-pages branch
68+
# - name: Sync docs into gh-pages
69+
# run: |
70+
# cd gh-pages
71+
# find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
72+
# cd ..
73+
# cp -R doc/docs/* gh-pages/
74+
#
75+
# # 8. Commit changes to g]h-pages
76+
# - name: Commit and push to gh-pages
77+
# working-directory: gh-pages
78+
# run: |
79+
# git config user.name "github-actions[bot]"
80+
# git config user.email "github-actions[bot]@users.noreply.github.com"
81+
#
82+
# git add .
83+
#
84+
# if git diff --cached --quiet; then
85+
# echo "No changes to push to gh-pages."
86+
# exit 0
87+
# fi
88+
#
89+
# git commit -m "Update generated docs"
90+
# git push origin gh-pages
91+
#
92+
# # 9. Create or update PR: gh-pages-pr -> gh-pages
93+
# - name: Create or update gh-pages PR
94+
# uses: peter-evans/create-pull-request@v7
95+
# with:
96+
# token: ${{ secrets.GITHUB_TOKEN }}
97+
# path: gh-pages
98+
# branch: gh-pages-pr
99+
# base: gh-pages
100+
# commit-message: "Update generated docs"
101+
# title: "Update generated docs on gh-pages"
102+
# body: |
103+
# This PR updates the `gh-pages` branch with the latest generated documentation.
104+
# A downloadable ZIP of the built docs is also available in the workflow artifacts.

0 commit comments

Comments
 (0)