Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/docs_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy Docs Preview

on:
pull_request_target:
paths:
- "mkdocs.yml"
- "docs/**"

permissions:
contents: read
pull-requests: write
deployments: write
statuses: write

jobs:
deploy:
runs-on: ubuntu-latest
environment: "deploy-to-netlify"
steps:
- uses: actions/checkout@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AIUI, on a pull_request_target trigger this checks out the repository on the target branch and not the pull request (quite intentionally), so this won't do what you want.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, okay. The docs around this use "in the context" which is a thing I don't know what it is and I couldn't tell which checkout you get.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/orgs/community/discussions/22363#discussioncomment-3236409 is probably a better summary than the docs themselves (oops)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks


- uses: actions/setup-python@v4
with:
python-version: "3.13"

- name: Install dependencies
run: |
pip install -r docs/requirements.txt

- name: Build site
run: |
mkdocs build --strict

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654
with:
publish-dir: "./site"
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
Loading