Skip to content

Commit 3af48b8

Browse files
committed
[FLINK-34953][ci]Add GitHub ci for flink-web to auto commit build files
1 parent 5dd082a commit 3af48b8

File tree

3 files changed

+68
-15
lines changed

3 files changed

+68
-15
lines changed

.github/workflows/docs.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: "Flink Web CI"
17+
on:
18+
pull_request:
19+
push:
20+
branches:
21+
- asf-site
22+
workflow_dispatch:
23+
24+
jobs:
25+
build-documentation:
26+
if: github.repository == 'apache/flink-web'
27+
runs-on: ubuntu-latest
28+
permissions:
29+
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
30+
contents: write
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
with:
35+
submodules: true
36+
fetch-depth: 0
37+
38+
- name: Setup Hugo
39+
uses: peaceiris/actions-hugo@v3
40+
with:
41+
hugo-version: '0.119.0'
42+
extended: true
43+
44+
- name: Build website
45+
run: |
46+
# Remove old content folder and create new one
47+
rm -r -f content && mkdir content
48+
49+
# Build the website
50+
hugo --source docs --destination target
51+
52+
# Move newly generated static HTML to the content serving folder
53+
mv docs/target/* content
54+
55+
# Copy quickstarts, rewrite rules and Google Search Console identifier
56+
cp -r _include/. content
57+
58+
# Get the current commit author
59+
echo "author=$(git log -1 --pretty=\"%an <%ae>\")" >> $GITHUB_OUTPUT
60+
61+
- name: Commit and push website build
62+
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
63+
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
64+
with:
65+
commit_author: ${{ steps.last-commit.outputs.author }}
66+
commit_message: Rebuild website

docs/content.zh/how-to-contribute/improve-website.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,4 @@ Flink 项目通过 [GitHub Mirror](https://github.com/apache/flink-web) 以提
9797

9898
### 合并 pull request
9999

100-
默认所有的修改仅在源文件上完成(对 `content/` 目录中自动生成的文件没有修改)。 在推送网站更改之前,请运行构建脚本。
101-
102-
```
103-
./build.sh
104-
```
105-
106-
将更改添加到 `content/` 目录作为附加提交,并将更改推送到 ASF 基本仓库。
107-
100+
默认所有的修改仅在源文件上完成(对 `content/` 目录中自动生成的文件没有修改)。

docs/content/how-to-contribute/improve-website.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,4 @@ Details on how to set the credentials for the ASF git repository are [linked her
9797

9898
### Merging a pull request
9999

100-
Contributions are expected to be done on the source files only (no modifications on the compiled files in the `content/` directory.). Before pushing a website change, please run the build script
101-
102-
```
103-
./build.sh
104-
```
105-
106-
add the changes to the `content/` directory as an additional commit and push the changes to the ASF base repository.
100+
Contributions are expected to be done on the source files only (no modifications on the compiled files in the `content/` directory.).

0 commit comments

Comments
 (0)