Skip to content

Commit 1f7792c

Browse files
committed
ci: add website workflow for gh-pages deployment
1 parent 8a37da3 commit 1f7792c

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/website.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Website
19+
20+
on:
21+
push:
22+
branches:
23+
- main
24+
pull_request:
25+
paths:
26+
- ".github/workflows/website.yml"
27+
- "docs/**"
28+
workflow_dispatch:
29+
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
32+
cancel-in-progress: true
33+
34+
permissions:
35+
contents: read
36+
37+
jobs:
38+
build:
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: write
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Setup Python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: "3.11"
49+
50+
- name: Install docs dependencies
51+
run: pip install mkdocs-material
52+
53+
- name: Build
54+
run: mkdocs build -f docs/mkdocs.yml -d docs/_site
55+
56+
- name: Copy ASF config
57+
run: cp .asf.yaml ./docs/_site/.asf.yaml
58+
59+
- name: Deploy to gh-pages
60+
uses: peaceiris/actions-gh-pages@v4.0.0
61+
if: github.event_name == 'push' && github.ref_name == 'main'
62+
with:
63+
github_token: ${{ secrets.GITHUB_TOKEN }}
64+
publish_dir: docs/_site
65+
publish_branch: gh-pages

0 commit comments

Comments
 (0)