Skip to content

Commit

Permalink
chore(ci): Use GitHub upload-pages-artifact and deploy-pages actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dantti committed Jul 8, 2024
1 parent 88acff0 commit d261fb9
Showing 1 changed file with 34 additions and 13 deletions.
47 changes: 34 additions & 13 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ on:
paths:
- docs/**
- mkdocs.yml
pull_request:
branches:
- main

# 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.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
mkdocs:
Expand All @@ -22,16 +37,22 @@ jobs:
pip install --user mkdocs-material
pip install --user mkdocs-build-plantuml-plugin
- name: Deploy GitHub Pages
run: |
mkdocs build
git worktree add gh-pages gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../site/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force
run: mkdocs build

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

# Deployment job, what was uploaded to artifact
deploy:
needs: mkdocs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit d261fb9

Please sign in to comment.