Skip to content

Commit e3d6e2d

Browse files
author
Hyeokmin Kwon
committed
Add github workflow
1 parent a0a2abd commit e3d6e2d

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/docs.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build & Deploy GitBook
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["master"]
7+
8+
permissions:
9+
contents: write
10+
11+
concurrency:
12+
group: gitbook-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
# CircleCI에서 node:8.12를 쓰고 있어서 호환성 위해 컨테이너로 맞춥니다.
20+
container:
21+
image: node:8.12
22+
23+
steps:
24+
- name: Install git (required in container)
25+
run: |
26+
apt-get update
27+
apt-get install -y git
28+
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Build GitBook
33+
run: |
34+
npm install -g gitbook-cli
35+
gitbook install
36+
gitbook build
37+
38+
- name: Upload _book artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: gitbook-_book
42+
path: _book
43+
44+
deploy:
45+
needs: build
46+
runs-on: ubuntu-latest
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
48+
49+
container:
50+
image: node:8.12
51+
52+
steps:
53+
- name: Install git (required in container)
54+
run: |
55+
apt-get update
56+
apt-get install -y git
57+
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
61+
- name: Build GitBook
62+
run: |
63+
npm install -g gitbook-cli
64+
gitbook install
65+
gitbook build
66+
67+
- name: Deploy to gh-pages
68+
uses: peaceiris/actions-gh-pages@v4
69+
with:
70+
github_token: ${{ secrets.GITHUB_TOKEN }}
71+
publish_branch: gh-pages
72+
publish_dir: ./_book

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
_book
2+
3+
.idea/

0 commit comments

Comments
 (0)