ci: update docs publishing using myst-version-switcher-plugin #1204
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| tags: ["*"] # '*' never matches '/', so e.g. release/x tags don't build | |
| jobs: | |
| lint: | |
| uses: ./.github/workflows/_tox.yml | |
| with: | |
| tox: pre-commit | |
| test: | |
| uses: ./.github/workflows/_test.yml | |
| with: | |
| runs-on: ubuntu-latest | |
| docs: # Call the docs building workflow directly | |
| uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/docs.yml@v0.24.1 | |
| with: | |
| # Whatever turns your sources into docs/_build/html at $BASE_URL. uv and Node | |
| # are preinstalled; so: make docs · tox -e docs · npm ci && npm run docs | |
| build-command: uv run --locked tox -e docs | |
| html-dir: build/html | |
| dist: | |
| uses: ./.github/workflows/_dist.yml | |
| example: | |
| needs: test | |
| if: github.ref_name == 'main' | |
| uses: ./.github/workflows/_example.yml | |
| secrets: | |
| EXAMPLE_DEPLOY_KEY: ${{ secrets.EXAMPLE_DEPLOY_KEY }} | |
| release: | |
| needs: [test, docs, dist] | |
| if: github.ref_type == 'tag' # tag pushes only | |
| uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/release.yml@v0.24.1 | |
| permissions: | |
| contents: write # create the Release + attach assets | |
| publish: | |
| needs: [docs] | |
| # don't publish a pages site in the fork's org | |
| if: github.repository == 'DiamondLightSource/python-copier-template' && github.ref_type == 'tag' # publish only on tags | |
| uses: ./.github/workflows/publish-dispatch.yml # your workflow (below) | |
| with: | |
| version-name: ${{ needs.docs.outputs.version-name }} | |
| permissions: | |
| contents: read | |
| actions: write | |
| pages: write | |
| id-token: write | |
| statuses: write |