Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions .github/workflows/python-deploy-docs-test-uv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# A workflow that runs on push/PR to check that python-deploy-docs-uv.yml works

name: python-deploy-docs-uv test workflow

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# schedules this to run weekly
# schedule:
# - cron: '5 3 * * 0' # At 03:05 on Sunday
push:
branches: [main, pre-release]
pull_request:
branches: [main, pre-release]

jobs:
call-test-workflow:
uses: ./.github/workflows/python-deploy-docs-uv.yml
with:
python-version: "3.12"
working-directory: samplePythonProjectUv
build-only: true
secrets: inherit
23 changes: 23 additions & 0 deletions .github/workflows/python-deploy-docs-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# A workflow that is scheduled to run regularly in order to check that python-deploy-docs.yml works

name: python-deploy-docs test workflow

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# schedules this to run weekly
# schedule:
# - cron: '5 3 * * 0' # At 03:05 on Sunday
push:
branches: [main, pre-release]
pull_request:
branches: [main, pre-release]

jobs:
call-test-workflow:
uses: ./.github/workflows/python-deploy-docs.yml
with:
python-version: "3.12"
working-directory: samplePythonProject
build-only: true
secrets: inherit
16 changes: 9 additions & 7 deletions .github/workflows/python-deploy-docs-uv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ on:
description: Which optional group or groups to install. Use comma delimiter for multiple groups e.g `dev,doc`.
required: false
type: string
default: dev
default: dev,doc
build-only:
description: If true, skip the upload and deploy steps (useful for testing the build without deploying to GitHub Pages).
required: false
type: boolean
default: false


# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand All @@ -47,9 +52,7 @@ concurrency:

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
environment: ${{ !inputs.build-only && 'github-pages' || '' }}
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.timeout-minutes }}
defaults:
Expand All @@ -70,18 +73,16 @@ jobs:

#----------------------------------------------
# build documentation
# - uv sync installs the project root by default; the composite action
# uses --no-install-project, so sync here to bring it in before building
#----------------------------------------------
- name: build documentation
run: |
uv sync
uv run mkdocs build

#----------------------------------------------
# package and upload artifact for deployment to GitHub Pages
#----------------------------------------------
- name: Upload artifact
if: ${{ !inputs.build-only }}
uses: actions/upload-pages-artifact@v4
with:
path: ${{ inputs.working-directory }}/site
Expand All @@ -91,5 +92,6 @@ jobs:
# deploy page
#----------------------------------------------
- name: Deploy Docs to GitHub Pages
if: ${{ !inputs.build-only }}
id: deployment
uses: actions/deploy-pages@v4
15 changes: 10 additions & 5 deletions .github/workflows/python-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ on:
description: Which optional group or groups to install. Use comma delimiter for multiple groups e.g `dev,doc`.
required: false
type: string
default: dev
default: dev,doc
build-only:
description: If true, skip the upload and deploy steps (useful for testing the build without deploying to GitHub Pages).
required: false
type: boolean
default: false


# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand All @@ -47,9 +52,7 @@ concurrency:

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
environment: ${{ !inputs.build-only && 'github-pages' || '' }}
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.timeout-minutes }}
defaults:
Expand Down Expand Up @@ -78,9 +81,10 @@ jobs:
poetry run mkdocs build

#----------------------------------------------
# package and upload artifact for deployment to GitHub Pages
# package and upload artifact for deployment to GitHub Pages
#----------------------------------------------
- name: Upload artifact
if: ${{ !inputs.build-only }}
uses: actions/upload-pages-artifact@v4
with:
path: ${{ inputs.working-directory }}/site
Expand All @@ -90,5 +94,6 @@ jobs:
# deploy page
#----------------------------------------------
- name: Deploy Docs to GitHub Pages
if: ${{ !inputs.build-only }}
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions samplePythonProject/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# theproject

Sample project documentation.
2 changes: 2 additions & 0 deletions samplePythonProject/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
site_name: theproject
docs_dir: docs
Loading
Loading