Skip to content

Commit

Permalink
Fix deploy mdbook workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
celinval committed Oct 6, 2023
1 parent 59cdb94 commit 5b326ed
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/deploy_mdbook.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
name: Deploy Book
on:
pull_request:
push:
branches:
- main

jobs:
ci:
name: CI
build-book:
name: Build Book
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: XAMPPRocky/deploy-mdbook@v1
- name: Checkout
uses: actions/checkout@v3

- name: Install mdbook
run: cargo install mdbook --version "^0.4" --locked

- name: Run mdbook
run: mdbook build

- name: Upload book
uses: actions/upload-pages-artifact@v2
with:
path: book/
retention-days: "3"

deploy-book:
name: Deploy Book
if: ${{ github.event_name == 'push' && startsWith('refs/heads/main', github.ref) }}
needs: build-book
runs-on: ubuntu-latest
steps:
- name: Deploy Book
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: book/
single-commit: true
22 changes: 1 addition & 21 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
# Run a job to ensure formatting is OK and that `mdbook` runs successfully
# Run a job to ensure formatting is OK
name: Format Check

on:
pull_request:
push:
branches:
- main

jobs:
# We can also use build_only input for the mdbook action. But the action is currently failing.
mdbook-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install mdbook
run: cargo install mdbook --version "^0.4" --locked

- name: Run mdbook
run: mdbook build

- name: Try mdbook action
uses: XAMPPRocky/deploy-mdbook@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
build_only: true

format-check:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 5b326ed

Please sign in to comment.