Merge pull request #66 from Canadian-Light-Source/63-epics-during-sta… #74
This file contains hidden or 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: documentation | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: # allow manual triggering | |
| inputs: | |
| deploy: | |
| description: 'Deploy wiki documentation' | |
| type: boolean | |
| required: true | |
| default: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-linux: | |
| name: CI py${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ '3.12' ] | |
| max-parallel: 5 | |
| env: | |
| python_version: ${{ matrix.python-version }} | |
| python_deploy_version: '3.8' # version to use for deployment | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Deploy Information | |
| if: ${{ github.event.inputs.deploy && env.python_version == env.python_deploy_version }} | |
| run: | | |
| echo "The HTML pyStxm documentation will be pushed to" | |
| echo " https://github.com/Canadian-Light-Source/pyStxm/tree/gh-pages" | |
| echo "The HTML pyStxm documentation will be deployed on" | |
| echo " https://Canadian-Light-Source.github.io/pyStxm/" | |
| - name: Install Requirements | |
| run: | | |
| python3 -m pip install --upgrade pip setuptools | |
| make install | |
| python3 -m pip list | |
| - name: Build Documentation | |
| run: | | |
| make html | |
| ls -lAFgh ./sphinx/build/html/index.html | |
| mkdir -p build | |
| mv ./sphinx/build/html/* build | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
| with: | |
| publish_branch: gh-pages | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: build | |
| force_orphan: true | |