|
| 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