GeezerVison is showing github.com — fix: docs deployment (#20) · FBumann/xarray_plotly@cd7ddc9
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/docs.yml +23Lines changed: 23 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3,13 +3,28 @@ name: Docs |
3 | 3 | on: |
4 | 4 | pull_request: |
5 | 5 | branches: [main] |
| 6 | + workflow_dispatch: # Manual trigger |
| 7 | + workflow_run: |
| 8 | + workflows: ["Release"] |
| 9 | + types: [completed] |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: write |
6 | 13 |
|
7 | 14 | jobs: |
8 | 15 | docs: |
9 | 16 | runs-on: ubuntu-latest |
| 17 | + # Run on PR, manual trigger, or successful Release |
| 18 | + if: | |
| 19 | + github.event_name == 'pull_request' || |
| 20 | + github.event_name == 'workflow_dispatch' || |
| 21 | + (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') |
10 | 22 |
|
11 | 23 | steps: |
12 | 24 | - uses: actions/checkout@v6 |
| 25 | + with: |
| 26 | + # For workflow_run, checkout the commit that triggered Release |
| 27 | + ref: ${{ github.event.workflow_run.head_sha || github.ref }} |
13 | 28 |
|
14 | 29 | - name: Install uv |
15 | 30 | uses: astral-sh/setup-uv@v7 |
|
19 | 34 |
|
20 | 35 | - name: Build docs |
21 | 36 | run: uv run mkdocs build |
| 37 | + |
| 38 | + - name: Deploy to GitHub Pages |
| 39 | + # Deploy on manual trigger or after successful Release |
| 40 | + if: github.event_name != 'pull_request' |
| 41 | + uses: peaceiris/actions-gh-pages@v4 |
| 42 | + with: |
| 43 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + publish_dir: ./site |
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/release.yml -12Lines changed: 0 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
29 | 29 | with: |
30 | 30 | generate_release_notes: true |
31 | 31 | files: dist/* |
32 | | - |
33 | | - - name: Install docs dependencies |
34 | | - run: uv sync --extra docs |
35 | | - |
36 | | - - name: Build docs |
37 | | - run: uv run mkdocs build |
38 | | - |
39 | | - - name: Deploy to GitHub Pages |
40 | | - uses: peaceiris/actions-gh-pages@v4 |
41 | | - with: |
42 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
43 | | - publish_dir: ./site |