Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
austinsonger committed Dec 5, 2024
1 parent 1fb35b8 commit 04b4c3a
Showing 1 changed file with 22 additions and 40 deletions.
62 changes: 22 additions & 40 deletions .github/workflows/mdbook-build-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,28 @@
name: github pages

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.36
steps:
- uses: actions/checkout@v4
- name: Install mdBook
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y
rustup update
cargo install --version ${MDBOOK_VERSION} mdbook
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with mdBook
working-directory: ./content # Ensure we are in the directory with `book.toml`
run: mdbook build -d ./output # Output the built files into /content/output
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./content/output # Adjusted to the correct build output directory
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- uses: actions/checkout@v2

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: 'latest'
- run: mdbook build -d ./content/output

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./content/output

0 comments on commit 04b4c3a

Please sign in to comment.