Skip to content

Commit 6316900

Browse files
authored
check mkdocs build strict in CI (apache#1360)
* add ci to release docs * run mkdocs in ci * use 3.12
1 parent 64dc6fe commit 6316900

File tree

2 files changed

+64
-17
lines changed

2 files changed

+64
-17
lines changed

.github/workflows/python-ci-docs.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@
1717
# under the License.
1818
#
1919

20-
name: "Python Docs"
20+
name: "Python CI Docs"
21+
2122
on:
22-
workflow_dispatch:
23+
push:
24+
branches:
25+
- 'main'
26+
pull_request:
27+
2328

2429
concurrency:
2530
group: ${{ github.workflow }}-${{ github.ref }}
@@ -33,24 +38,10 @@ jobs:
3338
- uses: actions/checkout@v4
3439
- uses: actions/setup-python@v5
3540
with:
36-
python-version: ${{ matrix.python }}
41+
python-version: 3.12
3742
- name: Install
3843
working-directory: ./mkdocs
3944
run: pip install -r requirements.txt
4045
- name: Build
4146
working-directory: ./mkdocs
4247
run: mkdocs build --strict
43-
- name: Copy
44-
working-directory: ./mkdocs
45-
run: mv ./site /tmp/site
46-
- name: Push changes to gh-pages branch
47-
run: |
48-
git checkout --orphan gh-pages-tmp
49-
git rm --quiet -rf .
50-
cp -r /tmp/site/* .
51-
git config --global user.name 'GitHub Actions'
52-
git config --global user.email '[email protected]'
53-
echo "py.iceberg.apache.org" > CNAME
54-
git add --all
55-
git commit -m 'Publish Python docs'
56-
git push -f origin gh-pages-tmp:gh-pages || true
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: "Release Docs"
21+
on:
22+
workflow_dispatch:
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
27+
28+
jobs:
29+
docs:
30+
runs-on: ubuntu-22.04
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: ${{ matrix.python }}
37+
- name: Install
38+
working-directory: ./mkdocs
39+
run: pip install -r requirements.txt
40+
- name: Build
41+
working-directory: ./mkdocs
42+
run: mkdocs build --strict
43+
- name: Copy
44+
working-directory: ./mkdocs
45+
run: mv ./site /tmp/site
46+
- name: Push changes to gh-pages branch
47+
run: |
48+
git checkout --orphan gh-pages-tmp
49+
git rm --quiet -rf .
50+
cp -r /tmp/site/* .
51+
git config --global user.name 'GitHub Actions'
52+
git config --global user.email '[email protected]'
53+
echo "py.iceberg.apache.org" > CNAME
54+
git add --all
55+
git commit -m 'Publish Python docs'
56+
git push -f origin gh-pages-tmp:gh-pages || true

0 commit comments

Comments
 (0)