Skip to content

Commit

Permalink
ci(deploy): Deploy directly
Browse files Browse the repository at this point in the history
Without needing to set up a publishing source, the `gh-pages` branch.

https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/
  • Loading branch information
YDX-2147483647 committed Jan 24, 2024
1 parent c1649e1 commit 58262e4
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# https://squidfunk.github.io/mkdocs-material/publishing-your-site/#with-github-actions
# https://www.mkdocs.org/user-guide/deploying-your-docs/#other-providers
# https://github.com/actions/starter-workflows/blob/main/pages/
name: deploy

on:
push:
branches:
Expand All @@ -9,13 +12,25 @@ on:
- '.github/**'
- 'scripts/**'
- '.pre-commit-config.yaml'
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
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:
deploy:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # RSS plugin needs all history
- uses: actions/setup-python@v4
Expand All @@ -28,4 +43,16 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ts-graphviz/setup-graphviz@v1
- run: just bootstrap
- run: mkdocs gh-deploy --force --no-history
- run: just build
- 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:
- uses: actions/deploy-pages@v4
id: deployment

0 comments on commit 58262e4

Please sign in to comment.