Skip to content

Commit 59589fa

Browse files
committed
feat(ci): add deploy workflow
Signed-off-by: Alex Chi <[email protected]>
1 parent 7c66dca commit 59589fa

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
name: Deploy
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
inputs:
10+
reason:
11+
description: 'why this workflow is triggered'
12+
required: true
13+
default: 'manually deploy site'
14+
15+
jobs:
16+
deploy_gh_pages:
17+
name: Deploy to GitHub Pages
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: actions-rs/toolchain@v1
22+
with:
23+
profile: minimal
24+
- name: Install mdbook
25+
run: cargo install mdbook mdbook-toc
26+
- name: Build docs
27+
working-directory: ./docs
28+
run: mdbook build
29+
- name: Deploy to GitHub Pages
30+
if: ${{ github.ref == 'refs/heads/main' }}
31+
uses: peaceiris/actions-gh-pages@v3
32+
with:
33+
publish_dir: ./docs/book
34+
user_name: 'github-actions[bot]'
35+
user_email: 'github-actions[bot]@users.noreply.github.com'
36+
force_orphan: true

0 commit comments

Comments
 (0)