-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Docs audit [April 2026]: Add dev docs #3336
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
base: docs/audit-2026
Are you sure you want to change the base?
Changes from all commits
d8d8092
2b7d710
880f72e
4d3623e
6e39a20
a08654b
2709a82
78e6dde
ef7c729
4e0b5f0
e6ba863
e2e1956
aa1c064
eaf049c
24a1f00
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 |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Build dev-docs (mkdocs) | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| python-version: | ||
| description: "Python version used to build the dev docs." | ||
| required: false | ||
| default: "3.10" | ||
| type: string | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
|
|
||
| - name: Install system dependencies for mkdocs-material social plugin | ||
| run: | | ||
| sudo apt-get update -qq | ||
| sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev \ | ||
| libjpeg-dev libpng-dev libz-dev | ||
|
|
||
| - name: Install dev-docs dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install ".[dev-docs]" | ||
|
|
||
| - name: Build dev docs | ||
| run: mkdocs build -v -f dev-docs/mkdocs.yml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: Deploy docs (main + dev-docs latest) | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build: | ||
| uses: ./.github/workflows/build-main-docs.yml | ||
| with: | ||
| python-version: "3.10" | ||
| build_dir: "./_build/html" | ||
| upload_artifact: true | ||
| secrets: inherit | ||
|
|
||
| deploy-main-docs: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Download built Jupyter Book artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: built-book | ||
| path: site | ||
|
|
||
| - name: Deploy main docs to gh-pages | ||
| uses: peaceiris/actions-gh-pages@v4 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: site | ||
| keep_files: true # preserve /dev/ versions managed by mike | ||
|
|
||
| deploy-dev-docs-latest: | ||
| needs: deploy-main-docs | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 # mike needs full history to read/write gh-pages branch | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.10" | ||
|
|
||
| - name: Install system dependencies for mkdocs-material social plugin | ||
| run: | | ||
| sudo apt-get update -qq | ||
| sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev \ | ||
| libjpeg-dev libpng-dev libz-dev | ||
|
|
||
| - name: Install dev-docs dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install ".[dev-docs]" | ||
|
|
||
| - name: Configure git for mike | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the bot need special permissions ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, we need to add permissions for pushing to the |
||
|
|
||
| - name: Deploy latest dev-docs with mike (main branch) | ||
| run: | | ||
| mike deploy --push \ | ||
| --config-file dev-docs/mkdocs.yml \ | ||
| --deploy-prefix dev \ | ||
| main | ||
| mike set-default --push \ | ||
| --config-file dev-docs/mkdocs.yml \ | ||
| --deploy-prefix dev \ | ||
| main | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we somehow avoid duplicates?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the deploy one
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes good suggestion, this is duplicated now indeed |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| name: Manage dev-docs versions (manual) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| action: | ||
| description: "Action to perform" | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - deploy-version | ||
| - delete-version | ||
| version_label: | ||
| description: "Version label to deploy or delete (e.g. 3.0)" | ||
| required: true | ||
| type: string | ||
| git_tag: | ||
| description: "Git tag to check out for deploy-version (e.g. v3.0.0rc14). Ignored for delete-version." | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| deploy-version: | ||
| if: ${{ inputs.action == 'deploy-version' }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Validate inputs | ||
| run: | | ||
| if [ -z "${{ inputs.git_tag }}" ]; then | ||
| echo "::error::git_tag is required for deploy-version" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 # mike needs full history to read/write gh-pages branch | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.10" | ||
|
|
||
| - name: Install system dependencies for mkdocs-material social plugin | ||
| run: | | ||
| sudo apt-get update -qq | ||
| sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev \ | ||
| libjpeg-dev libpng-dev libz-dev | ||
|
|
||
| - name: Check out tagged source tree | ||
| run: git checkout "${{ inputs.git_tag }}" -- deeplabcut | ||
|
|
||
| - name: Install dev-docs dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install ".[dev-docs]" | ||
|
|
||
| - name: Configure git for mike | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| - name: Deploy version with mike | ||
| run: | | ||
| mike deploy --push \ | ||
| --config-file dev-docs/mkdocs.yml \ | ||
| --deploy-prefix dev \ | ||
| "${{ inputs.version_label }}" | ||
|
|
||
| delete-version: | ||
| if: ${{ inputs.action == 'delete-version' }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 # mike needs full history to read/write gh-pages branch | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.10" | ||
|
|
||
| - name: Install dev-docs dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install ".[dev-docs]" | ||
|
|
||
| - name: Configure git for mike | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| - name: Delete version with mike | ||
| run: | | ||
| mike delete --push \ | ||
| --config-file dev-docs/mkdocs.yml \ | ||
| --deploy-prefix dev \ | ||
| "${{ inputs.version_label }}" |
This file was deleted.
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.
It might make sense to have concurrency guards in anything that deploys to gh-pages
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.
agreed! As long as we don't overcomplicate things.
I am more worried about subsequent pushes that trigger the latest-doc build than race conditions between main-docs and dev-docs as they write to independent output dirs