Runtime fix #32
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
name: Docs | |
on: | |
push: | |
branches: | |
- main | |
# workflow_dispatch: # Un comment line if you also want to trigger action manually | |
jobs: | |
sphinx_docs_to_gh-pages: | |
runs-on: ubuntu-22.04 | |
name: Docs | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Skip workflow if only certain files have been changed. | |
- name: Get changed files | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: | | |
benchmark/** | |
examples/** | |
README.md | |
CHANGELOG.md | |
requirements.txt | |
- name: Install requirement packages | |
if: steps.changed-files-specific.outputs.only_changed != 'true' | |
uses: ./.github/actions/setup | |
with: | |
full_install: false | |
- name: Install project packages | |
if: steps.changed-files-specific.outputs.only_changed != 'true' | |
run: | | |
pip install -e .[docs,benchmark] | |
- name: Enable github problem matcher | |
uses: sphinx-doc/github-problem-matcher@master | |
- id: build | |
name: Build documentation | |
if: steps.changed-files-specific.outputs.only_changed != 'true' | |
run: ./.github/actions/docs.sh | |
shell: bash | |
env: | |
# See https://github.com/actions/runner/issues/665 | |
INPUT_DOCUMENTATION_PATH: './docs/source' | |
INPUT_SPHINX_BUILD_OPTIONS: '' | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
if: steps.changed-files-specific.outputs.only_changed != 'true' | |
- name: Fix file permissions | |
shell: sh | |
if: runner.os == 'Linux' | |
# https://github.com/actions/deploy-pages/issues/188 | |
run: | | |
chmod -c -R +rX "$INPUT_PATH" | | |
while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
env: | |
INPUT_PATH: ${{ steps.build.outputs.artifact }} | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
if: steps.changed-files-specific.outputs.only_changed != 'true' | |
with: | |
path: ${{ steps.build.outputs.artifact }} | |
- id: deployment | |
name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 | |
if: steps.changed-files-specific.outputs.only_changed != 'true' |