Skip to content

Commit eaa7bd1

Browse files
committed
Update mdbook.yml
1 parent 8b6773f commit eaa7bd1

File tree

1 file changed

+25
-51
lines changed

1 file changed

+25
-51
lines changed

.github/workflows/mdbook.yml

Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,39 @@
1-
# Sample workflow for building and deploying a mdBook site to GitHub Pages
2-
#
3-
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html
4-
#
5-
name: Deploy mdBook site to Pages
6-
1+
name: Deploy
72
on:
8-
# Runs on pushes targeting the default branch
93
push:
10-
branches: ["main"]
11-
12-
# Allows you to run this workflow manually from the Actions tab
13-
workflow_dispatch:
14-
15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16-
permissions:
17-
contents: read
18-
pages: write
19-
id-token: write
20-
21-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23-
concurrency:
24-
group: "pages"
25-
cancel-in-progress: false
4+
branches:
5+
- main
266

277
jobs:
28-
# Build job
29-
build:
8+
deploy:
309
runs-on: ubuntu-latest
31-
env:
32-
MDBOOK_VERSION: 0.4.36
10+
permissions:
11+
contents: write # To push a branch
12+
pages: write # To push to a GitHub Pages site
13+
id-token: write # To update the deployment status
3314
steps:
34-
- uses: actions/checkout@v3
35-
- name: Install mdBook
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Install latest mdbook
3619
run: |
37-
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
38-
rustup update
39-
cargo install --version ${MDBOOK_VERSION} mdbook
40-
- name: Install mdBook Preprocessors
20+
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
21+
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
22+
mkdir mdbook
23+
curl -sSL $url | tar -xz --directory=./mdbook
24+
echo `pwd`/mdbook >> $GITHUB_PATH
25+
- name: Build Book
4126
run: |
42-
cargo install mdbook-admonish
43-
mdbook-admonish install
44-
cargo install mdbook-toc
27+
# This assumes your book is in the root of your repository.
28+
# Just add a `cd` here if you need to change to another directory.
29+
mdbook build
4530
- name: Setup Pages
46-
id: pages
47-
uses: actions/configure-pages@v3
48-
- name: Build with mdBook
49-
run: mdbook build
31+
uses: actions/configure-pages@v4
5032
- name: Upload artifact
5133
uses: actions/upload-pages-artifact@v3
5234
with:
53-
path: ./book
54-
55-
# Deployment job
56-
deploy:
57-
environment:
58-
name: github-pages
59-
url: ${{ steps.deployment.outputs.page_url }}
60-
runs-on: ubuntu-latest
61-
needs: build
62-
steps:
35+
# Upload entire repository
36+
path: 'book'
6337
- name: Deploy to GitHub Pages
6438
id: deployment
65-
uses: actions/deploy-pages@v2
39+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)