Skip to content

Commit

Permalink
feat(actions): Add actions to publish docs
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Luc Davern <[email protected]>
  • Loading branch information
jdavv committed Jan 16, 2025
1 parent 7818d83 commit 28f6452
Showing 1 changed file with 48 additions and 11 deletions.
59 changes: 48 additions & 11 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,62 @@
---
name: Publish GitHub Pages
name: Publish MkDocs to GitHub Pages
on:
workflow_dispatch:
# Runs on pushes targeting the default branch
push:
branches:
- main
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
publish-gh-pages:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: virtualenv cache
uses: actions/cache@v4
with:
path: |
.venv
key: venv-${{ hashFiles('./poetry.lock') }}

- name: Install devbox
uses: jetpack-io/[email protected]
with:
enable-cache: "true"

- uses: actions/configure-pages@v5

- name: Setup Python environment
run: |
devbox run -- poetry install
- name: Build and deploy docs
run: |
devbox run -- poetry run mkdocs gh-deploy --force --no-history --remote-branch gh-pages
- name: Build site
run: devbox run -- poetry run mkdocs build

- name: Upload site
uses: actions/upload-pages-artifact@v3
with:
path: ./site

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 28f6452

Please sign in to comment.