Skip to content

Commit 5a7afa3

Browse files
authored
Publish Athena Client docs only when a release is created. (#21)
* ci: only trigger doc build on release publish * ci: build on push but don't publish
1 parent 57cd828 commit 5a7afa3

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/docs.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
- "README.md"
2020
- "pyproject.toml"
2121
- ".github/workflows/docs.yml"
22+
release:
23+
types: [published]
2224
workflow_dispatch:
2325
inputs:
2426
reason:
@@ -58,19 +60,25 @@ jobs:
5860
- name: Build documentation
5961
run: |
6062
cd docs
61-
uv run make clean
62-
uv run make html
63+
uv run make clean html
6364
6465
- name: Setup Pages
6566
uses: actions/configure-pages@v5
66-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
67+
if: github.event_name == 'release' && github.event.action == 'published'
6768

68-
- name: Upload artifact
69+
- name: Upload artifact for GitHub Pages
6970
uses: actions/upload-pages-artifact@v4
70-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
71+
if: github.event_name == 'release' && github.event.action == 'published'
7172
with:
7273
path: docs/_build/html
7374

75+
- name: Upload documentation artifacts
76+
uses: actions/upload-artifact@v4
77+
if: github.event_name != 'release'
78+
with:
79+
name: documentation
80+
path: docs/_build/html
81+
7482
- name: Upload build artifacts for debugging
7583
uses: actions/upload-artifact@v4
7684
if: failure()
@@ -86,7 +94,7 @@ jobs:
8694
url: ${{ steps.deployment.outputs.page_url }}
8795
runs-on: ubuntu-latest
8896
needs: build
89-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
97+
if: github.event_name == 'release' && github.event.action == 'published'
9098
steps:
9199
- name: Deploy to GitHub Pages
92100
id: deployment

0 commit comments

Comments
 (0)