-
Notifications
You must be signed in to change notification settings - Fork 16
ci: standardize docs workflow #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,13 +16,15 @@ jobs: | |
| build: | ||
| name: Build & Deploy Docs | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DOCS_DEPLOY_KEY: ${{ secrets.DOCS_DEPLOY_KEY }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v8 | ||
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | ||
| with: | ||
| version: "latest" | ||
|
|
||
|
|
@@ -33,16 +35,13 @@ jobs: | |
| run: uv sync --dev --extra docs | ||
|
|
||
| - name: Build docs | ||
| # The docs tree includes archived/reference pages and legacy relative | ||
| # links that are useful to keep but currently emit MkDocs warnings. | ||
| # Build failures should still stop deployment; warning cleanup can be | ||
| # handled separately without blocking docs publication. | ||
| run: uv run mkdocs build | ||
|
|
||
| - name: Deploy to website repo | ||
| if: ${{ env.DOCS_DEPLOY_KEY != '' }} | ||
| uses: cpina/github-action-push-to-another-repository@v1.7.2 | ||
|
||
| env: | ||
| SSH_DEPLOY_KEY: ${{ secrets.DOCS_DEPLOY_KEY }} | ||
| SSH_DEPLOY_KEY: ${{ env.DOCS_DEPLOY_KEY }} | ||
| with: | ||
| source-directory: site/ | ||
| destination-github-username: ml4t | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOCS_DEPLOY_KEYis being exported at the job level, which makes the deploy key available to every step (including third-party actions likeactions/checkoutandastral-sh/setup-uv). To follow least-privilege, scope the secret to only the deploy step and useif: ${{ secrets.DOCS_DEPLOY_KEY != '' }}(or similar) instead of routing it throughenvat the job level.