-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GH] Decouple distribution and docs release workflows (#412)
* split build-release into a workflow for dist- and docs-release * split build-release into a workflow for dist- and docs-release * rename gh job in dist-release * adding to trigger docs workflow * reverting doc change * ignore changes inside .github dir for dist build workflow * update workflow triggers to include push to master, PR change and workflow dispatch * update to deploy if version changes or workflow is manually triggered * change docs to trigger workflow * Revert "change docs to trigger workflow" This reverts commit cef461a.
- Loading branch information
Showing
2 changed files
with
57 additions
and
36 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: docs-release | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
paths: | ||
- 'docs/**' # Trigger when files inside docs folder are changed | ||
pull_request: | ||
paths: | ||
- 'docs/**' # Trigger when docs are changed within a pull request | ||
workflow_dispatch: # Allow manual triggering of the workflow | ||
|
||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Build docs | ||
working-directory: ./python | ||
run: tox -e build-docs | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: html-docs | ||
path: docs/_build/html/ | ||
|
||
- name: Deploy 🚀 | ||
uses: peaceiris/actions-gh-pages@v3 | ||
# Deploy to the gh-pages branch when a tag is pushed or the workflow is manually triggered | ||
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/_build/html |