-
Notifications
You must be signed in to change notification settings - Fork 20
45 lines (38 loc) · 934 Bytes
/
build-deploy.yml
File metadata and controls
45 lines (38 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build (and deploy)
on:
- push
- pull_request
- workflow_dispatch
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: '0.4.37'
# mdbook-version: 'latest'
- run: mdbook build
- name: Create artifact
uses: actions/upload-artifact@v7
with:
name: book
path: book
deploy:
name: Deploy
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Fetch build artifact
uses: actions/download-artifact@v8
with:
name: book
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
cname: guide.encode.moe