ci: build release docs from the branch tip, not the dispatch ref (#847) #231
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 (master) | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags-ignore: | |
| - "**" # Ignore all tags to avoid duplicate executions triggered by tag pushes. | |
| # Allow re-running the Checks manually. Release jobs below are gated on `github.event_name == 'push'` | |
| # so they never fire on manual dispatch. | |
| workflow_dispatch: | |
| inputs: | |
| run_tests: | |
| description: Whether to run the test suites (unit, integration). | |
| required: false | |
| type: boolean | |
| default: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| checks: | |
| name: Checks | |
| uses: ./.github/workflows/_checks.yaml | |
| with: | |
| # On push: skip the test suites for docs-only commits — they don't change runtime behavior. | |
| # On manual dispatch: honor the input. | |
| run_tests: ${{ github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'docs') || github.event_name == 'workflow_dispatch' && inputs.run_tests }} | |
| secrets: inherit | |
| doc_release: | |
| # Only on push, and only for "docs" commits. | |
| if: github.event_name == 'push' && startsWith(github.event.head_commit.message, 'docs') | |
| name: Doc release | |
| needs: [checks] | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| checks: read | |
| uses: ./.github/workflows/manual_release_docs.yaml | |
| secrets: inherit | |
| # The beta release is dispatched as a separate workflow run (instead of calling `manual_release_beta.yaml` via `uses:`) | |
| # because PyPI's Trusted Publishing does not currently support reusable workflows. | |
| # See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github | |
| beta_release: | |
| # Only on push, and only for "feat", "fix", "perf", "refactor" and "style" commits. | |
| if: >- | |
| github.event_name == 'push' && ( | |
| startsWith(github.event.head_commit.message, 'feat') || | |
| startsWith(github.event.head_commit.message, 'fix') || | |
| startsWith(github.event.head_commit.message, 'perf') || | |
| startsWith(github.event.head_commit.message, 'refactor') || | |
| startsWith(github.event.head_commit.message, 'style') | |
| ) | |
| name: Beta release | |
| needs: [checks] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write # Required by execute-workflow. | |
| steps: | |
| - name: Dispatch beta release workflow | |
| uses: apify/actions/execute-workflow@v1.2.0 | |
| with: | |
| workflow: manual_release_beta.yaml |