Skip to content

Commit 5ad0318

Browse files
committed
Add deploy script
1 parent b0b12a6 commit 5ad0318

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write # To push a branch
11+
pages: write # To push to a GitHub Pages site
12+
id-token: write # To update the deployment status
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: init
18+
run: |
19+
url="https://github.com/rust-lang/mdBook/releases/download/v0.4.47/mdbook-v0.4.47-x86_64-unknown-linux-gnu.tar.gz"
20+
mkdir mdbook
21+
curl -sSL $url | tar -xz --directory=./mdbook
22+
echo `pwd`/mdbook >> $GITHUB_PATH
23+
- name: build book
24+
run: |
25+
cd guide
26+
mdbook build
27+
- name: setup pages
28+
uses: actions/configure-pages@v4
29+
- name: upload artifact
30+
uses: actions/upload-pages-artifact@v3
31+
with:
32+
path: 'book'
33+
- name: Deploy to GitHub Pages
34+
id: deployment
35+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)