| 1 |
name: Docs |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
|
| 8 |
jobs: |
| 9 |
build: |
| 10 |
|
| 11 |
runs-on: ubuntu-latest |
| 12 |
|
| 13 |
steps: |
| 14 |
- uses: actions/checkout@v4 |
| 15 |
- uses: mamba-org/setup-micromamba@v1 |
| 16 |
with: |
| 17 |
environment-file: ci/environment-docs.yml |
| 18 |
- name: make docs |
| 19 |
shell: bash -l {0} |
| 20 |
run: | |
| 21 |
cd docs |
| 22 |
make html |
| 23 |
- name: Commit documentation changes |
| 24 |
run: | |
| 25 |
git clone https://github.com/fsspec/kerchunk.git --branch gh-pages --single-branch gh-pages |
| 26 |
cp -r docs/build/html/* gh-pages/ |
| 27 |
cd gh-pages |
| 28 |
touch .nojekyll |
| 29 |
git config --local user.email "[email protected]" |
| 30 |
git config --local user.name "GitHub Action" |
| 31 |
git add . |
| 32 |
git commit -m "Update documentation" -a || true |
| 33 |
# The above command will fail if no changes were present, so we ignore |
| 34 |
# that. |
| 35 |
- name: Push changes |
| 36 |
uses: ad-m/github-push-action@master |
| 37 |
with: |
| 38 |
branch: gh-pages |
| 39 |
directory: gh-pages |
| 40 |
github_token: ${{ secrets.GITHUB_TOKEN }} |