Skip to content

Commit

Permalink
Drop mike versioning from documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
djperrefort committed Oct 13, 2023
1 parent 9849207 commit dba9ea0
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 43 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/DocumentationBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build Documentation

on:
workflow_dispatch:
workflow_call:
pull_request:

jobs:
build:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false

- name: Install dependencies
run: poetry install --with docs

- name: Build documentation
run: mkdocs build

- name: Upload docs to artifact storage
uses: actions/upload-pages-artifact@v2
with:
path: site
66 changes: 23 additions & 43 deletions .github/workflows/DocumentationPublish.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,32 @@
name: Publish Documentation

on:
workflow_call:
inputs:
version:
description: 'The documentation version number'
default: 'develop'
type: string
latest:
description: 'Set the new build as the latest version'
default: false
type: boolean
push:
branches: [ main ]
workflow_dispatch:

jobs:
publish:
name: Publish HTML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
permissions:
contents: read
pages: write
id-token: write

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
jobs:
build:
name: Build
uses: ./.github/workflows/DocumentationBuild.yml
secrets: inherit

- name: Install dependencies
shell: bash
run: poetry install --with docs
deploy:
name: Deploy Documentation
needs: [ build ]

- name: Configure git
run: |
git config --global user.name "Documentation CI"
git config --global user.email [email protected]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

- name: Build and publish
run: poetry run mike deploy --push ${{ inputs.version || 'develop' }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Update latest version
if: ${{ inputs.latest }}
run: |
poetry run mike alias --update-aliases --push ${{ inputs.version }} latest
poetry run mike set-default --push latest
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ poetry.lock

# Coverage results
.coverage

# Compiled project documentation
site

0 comments on commit dba9ea0

Please sign in to comment.