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
72on :
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
277jobs :
28- # Build job
29- build :
8+ deploy :
309 runs-on : ubuntu-latest
31- env :
32- MDBOOK_VERSION : 0.4.21
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
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
26+ run : |
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
4030 - name : Setup Pages
41- id : pages
42- uses : actions/configure-pages@v3
43- - name : Build with mdBook
44- run : mdbook build book
31+ uses : actions/configure-pages@v4
4532 - name : Upload artifact
46- uses : actions/upload-pages-artifact@v2
33+ uses : actions/upload-pages-artifact@v3
4734 with :
48- path : ./book
49-
50- # Deployment job
51- deploy :
52- environment :
53- name : github-pages
54- url : ${{ steps.deployment.outputs.page_url }}
55- runs-on : ubuntu-latest
56- needs : build
57- steps :
35+ # Upload entire repository
36+ path : ' book'
5837 - name : Deploy to GitHub Pages
5938 id : deployment
60- uses : actions/deploy-pages@v2
39+ uses : actions/deploy-pages@v4
0 commit comments