Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX committed Aug 25, 2024
1 parent 0014c62 commit 5fe142b
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,44 @@
# Sample workflow for building and deploying a mdBook site to GitHub Pages
#
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html
#
name: Deploy mdBook site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["mdbook"]

# Allows you to run this workflow manually from the Actions tab
pull_request:
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.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
group: "pages-${{ github.ref }}"
cancel-in-progress: false

jobs:
# Build job
build:
name: Build Site
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.36
MDBOOK_VERSION: v0.4.40
steps:
- uses: actions/checkout@v4
- name: Install mdBook
run: curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar xz
run: curl -L "https://github.com/rust-lang/mdBook/releases/download/$MDBOOK_VERSION/mdbook-$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz" | tar xz
- name: Build with mdBook
run: ./mdbook build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./book

# Deployment job
deploy:
name: Deploy Site
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
runs-on: ubuntu-latest
needs: build
steps:
Expand Down

0 comments on commit 5fe142b

Please sign in to comment.