1- name : Deploy Documentation
1+ name : " Release Docs "
22
33on :
4+ workflow_dispatch :
45 push :
56 branches :
67 - main
78 paths :
89 - ' mkdocs/**'
910 - ' src/**'
10- pull_request :
11- branches :
12- - main
13- paths :
14- - ' mkdocs/**'
15- - ' src/**'
16-
17- permissions :
18- contents : read
19- pages : write
20- id-token : write
2111
2212concurrency :
23- group : " pages "
24- cancel-in-progress : false
13+ group : ${{ github.workflow }}-${{ github.ref }}
14+ cancel-in-progress : ${{ github.event_name == 'pull_request' }}
2515
2616jobs :
27- build :
17+ docs :
2818 runs-on : ubuntu-latest
19+
2920 steps :
30- - name : Checkout
31- uses : actions/checkout@v4
21+ - uses : actions/checkout@v5
22+ with :
23+ fetch-depth : 0
3224
33- - name : Setup Python
34- uses : actions/setup-python@v4
25+ - uses : actions/setup-python@v6
3526 with :
3627 python-version : ' 3.11'
3728
@@ -42,37 +33,33 @@ jobs:
4233 sudo apt-get update
4334 sudo apt-get install -y doxygen
4435
45- - name : Setup Pages
46- uses : actions/configure-pages@v4
47-
4836 - name : Build API documentation with Doxygen
4937 run : |
5038 cd mkdocs
5139 mkdir -p docs/api
5240 doxygen Doxyfile
41+ echo "Doxygen output created in docs/api/"
5342
54- - name : Build with MkDocs
43+ - name : Build docs
5544 run : |
5645 cd mkdocs
5746 mkdocs build --clean
47+ echo "MkDocs site built in site/"
5848
59- - name : Copy CNAME file
49+ - name : Copy
50+ working-directory : ./mkdocs
6051 run : |
61- cp mkdocs/CNAME mkdocs/site/CNAME
62-
63- - name : Upload artifact
64- uses : actions/upload-pages-artifact@v3
65- with :
66- path : ./mkdocs/site
52+ echo "Copying site contents to /tmp/site"
53+ cp -r ./site/* /tmp/site/
6754
68- deploy :
69- environment :
70- name : github- pages
71- url : ${{ steps.deployment.outputs.page_url }}
72- runs-on : ubuntu-latest
73- needs : build
74- if : github.ref == 'refs/heads/main '
75- steps :
76- - name : Deploy to GitHub Pages
77- id : deployment
78- uses : actions/deploy- pages@v4
55+ - name : Push changes to gh-pages branch
56+ run : |
57+ git checkout --orphan gh- pages-tmp
58+ git rm --quiet -rf .
59+ cp -r /tmp/site/* .
60+ git config --global user.name 'GitHub Actions'
61+ git config --global user.email '[email protected] ' 62+ echo "cpp.iceberg.apache.org" > CNAME
63+ git add --all
64+ git commit -m 'Publish C++ docs'
65+ git push -f origin gh- pages-tmp:gh-pages || true
0 commit comments