1
- name : Deploy Documentation
1
+ name : " Release Docs "
2
2
3
3
on :
4
+ workflow_dispatch :
4
5
push :
5
6
branches :
6
7
- main
7
8
paths :
8
9
- ' mkdocs/**'
9
10
- ' 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
21
11
22
12
concurrency :
23
- group : " pages "
24
- cancel-in-progress : false
13
+ group : ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress : ${{ github.event_name == 'pull_request' }}
25
15
26
16
jobs :
27
- build :
17
+ docs :
28
18
runs-on : ubuntu-latest
19
+
29
20
steps :
30
- - name : Checkout
31
- uses : actions/checkout@v4
21
+ - uses : actions/checkout@v5
22
+ with :
23
+ fetch-depth : 0
32
24
33
- - name : Setup Python
34
- uses : actions/setup-python@v4
25
+ - uses : actions/setup-python@v6
35
26
with :
36
27
python-version : ' 3.11'
37
28
@@ -42,37 +33,33 @@ jobs:
42
33
sudo apt-get update
43
34
sudo apt-get install -y doxygen
44
35
45
- - name : Setup Pages
46
- uses : actions/configure-pages@v4
47
-
48
36
- name : Build API documentation with Doxygen
49
37
run : |
50
38
cd mkdocs
51
39
mkdir -p docs/api
52
40
doxygen Doxyfile
41
+ echo "Doxygen output created in docs/api/"
53
42
54
- - name : Build with MkDocs
43
+ - name : Build docs
55
44
run : |
56
45
cd mkdocs
57
46
mkdocs build --clean
47
+ echo "MkDocs site built in site/"
58
48
59
- - name : Copy CNAME file
49
+ - name : Copy
50
+ working-directory : ./mkdocs
60
51
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/
67
54
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