Skip to content

Commit

Permalink
fix: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mablin7 committed Nov 26, 2023
1 parent cd13ca6 commit 500dd8b
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,25 @@ on:
branches:
- main
paths: ["docs/**/*"]
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-20.04
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -22,9 +35,25 @@ jobs:
- run: mdbook build
working-directory: ./docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
- name: Archive artifact
shell: sh
working-directory: ./docs/book
run: |
tar \
--dereference --hard-dereference \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
name: "github-pages"
path: ${{ runner.temp }}/artifact.tar
retention-days: 1
if-no-files-found: error

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

0 comments on commit 500dd8b

Please sign in to comment.