|
| 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 | + branches: |
| 20 | + - asf-site |
| 21 | + push: |
| 22 | + branches: |
| 23 | + - asf-site |
| 24 | + workflow_dispatch: |
| 25 | + |
| 26 | +jobs: |
| 27 | + build-documentation: |
| 28 | + if: github.repository == 'apache/flink-web' |
| 29 | + runs-on: ubuntu-latest |
| 30 | + permissions: |
| 31 | + # Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. |
| 32 | + contents: write |
| 33 | + steps: |
| 34 | + - name: Checkout repository |
| 35 | + uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + submodules: true |
| 38 | + fetch-depth: 0 |
| 39 | + |
| 40 | + - name: Setup Hugo |
| 41 | + uses: peaceiris/actions-hugo@v3 |
| 42 | + with: |
| 43 | + hugo-version: '0.119.0' |
| 44 | + extended: true |
| 45 | + |
| 46 | + - name: Build website |
| 47 | + run: | |
| 48 | + # Remove old content folder and create new one |
| 49 | + rm -r -f content && mkdir content |
| 50 | +
|
| 51 | + # Build the website |
| 52 | + hugo --source docs --destination target |
| 53 | +
|
| 54 | + # Move newly generated static HTML to the content serving folder |
| 55 | + mv docs/target/* content |
| 56 | +
|
| 57 | + # Copy quickstarts, rewrite rules and Google Search Console identifier |
| 58 | + cp -r _include/. content |
| 59 | + |
| 60 | + #Get the current commit author |
| 61 | + echo "author=$(git log -1 --pretty=\"%an <%ae>\")" >> $GITHUB_OUTPUT |
| 62 | +
|
| 63 | + - name: Commit and push website build |
| 64 | + if: ${{ github.event_name == 'push' }} |
| 65 | + uses: stefanzweifel/git-auto-commit-action@v5 |
| 66 | + with: |
| 67 | + commit_author: ${{ steps.last-commit.outputs.author }} |
| 68 | + commit_message: Rebuild website |
0 commit comments