-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-34953][ci]Add GitHub ci for flink-web to auto commit build files
- Loading branch information
1 parent
5dd082a
commit 3af48b8
Showing
3 changed files
with
68 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: "Flink Web CI" | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- asf-site | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-documentation: | ||
if: github.repository == 'apache/flink-web' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v3 | ||
with: | ||
hugo-version: '0.119.0' | ||
extended: true | ||
|
||
- name: Build website | ||
run: | | ||
# Remove old content folder and create new one | ||
rm -r -f content && mkdir content | ||
# Build the website | ||
hugo --source docs --destination target | ||
# Move newly generated static HTML to the content serving folder | ||
mv docs/target/* content | ||
# Copy quickstarts, rewrite rules and Google Search Console identifier | ||
cp -r _include/. content | ||
# Get the current commit author | ||
echo "author=$(git log -1 --pretty=\"%an <%ae>\")" >> $GITHUB_OUTPUT | ||
- name: Commit and push website build | ||
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | ||
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 | ||
with: | ||
commit_author: ${{ steps.last-commit.outputs.author }} | ||
commit_message: Rebuild website |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters