Skip to content

Commit ec4cc19

Browse files
committed
test
1 parent 4f6cbe1 commit ec4cc19

File tree

2 files changed

+92
-44
lines changed

2 files changed

+92
-44
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
name: Build my gitbook and deploy to gh-pages
1+
# name: Build my gitbook and deploy to gh-pages
22

3-
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- master
3+
# on:
4+
# workflow_dispatch:
5+
# push:
6+
# branches:
7+
# - master
88

9-
jobs:
10-
master-to-gh-pages:
11-
runs-on: ubuntu-latest
9+
# jobs:
10+
# master-to-gh-pages:
11+
# runs-on: ubuntu-latest
1212

13-
steps:
14-
- name: checkout master
15-
uses: actions/checkout@v2
16-
with:
17-
submodules: recursive
18-
ref: master
13+
# steps:
14+
# - name: checkout master
15+
# uses: actions/checkout@v2
16+
# with:
17+
# submodules: recursive
18+
# ref: master
1919

20-
- name: install nodejs
21-
uses: actions/setup-node@v1
20+
# - name: install nodejs
21+
# uses: actions/setup-node@v1
2222

23-
- name: configue gitbook
24-
run: |
25-
npm install -g gitbook-cli
26-
gitbook install
27-
npm install -g gitbook-summary
23+
# - name: configue gitbook
24+
# run: |
25+
# npm install -g gitbook-cli
26+
# gitbook install
27+
# npm install -g gitbook-summary
2828

29-
- name: generate _book folder
30-
run: |
31-
book sm
32-
ln -s -f SUMMARY.md Content.md
33-
gitbook build
34-
cp SUMMARY.md _book
29+
# - name: generate _book folder
30+
# run: |
31+
# book sm
32+
# ln -s -f SUMMARY.md Content.md
33+
# gitbook build
34+
# cp SUMMARY.md _book
3535

36-
- name: push _book to branch gh-pages
37-
env:
38-
TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
39-
REF: github.com/${{github.repository}}
40-
MYEMAIL: kimi0230@gmail.com
41-
MYNAME: ${{github.repository_owner}}
42-
run: |
43-
cd _book
44-
git config --global user.email "${MYEMAIL}"
45-
git config --global user.name "${MYNAME}"
46-
git init
47-
git remote add origin https://${REF}
48-
git add .
49-
git commit -m "Updated By Github Actions With Build ${{github.run_number}} of ${{github.workflow}} For Github Pages"
50-
git branch -M master
51-
git push --force --quiet "https://${TOKEN}@${REF}" master:gh-pages
36+
# - name: push _book to branch gh-pages
37+
# env:
38+
# TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
39+
# REF: github.com/${{github.repository}}
40+
# MYEMAIL: kimi0230@gmail.com
41+
# MYNAME: ${{github.repository_owner}}
42+
# run: |
43+
# cd _book
44+
# git config --global user.email "${MYEMAIL}"
45+
# git config --global user.name "${MYNAME}"
46+
# git init
47+
# git remote add origin https://${REF}
48+
# git add .
49+
# git commit -m "Updated By Github Actions With Build ${{github.run_number}} of ${{github.workflow}} For Github Pages"
50+
# git branch -M master
51+
# git push --force --quiet "https://${TOKEN}@${REF}" master:gh-pages

.github/workflows/releace.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build latest tag
2+
3+
# on:
4+
# push:
5+
# tags: ["v*"]
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build:
14+
name: Build
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: checkout master
18+
uses: actions/checkout@v2
19+
with:
20+
ref: master
21+
- name: install nodejs
22+
uses: actions/setup-node@v1
23+
24+
- name: configue gitbook
25+
run: |
26+
npm install -g gitbook-cli
27+
gitbook install
28+
npm install -g gitbook-summary
29+
- name: generate _book folder
30+
run: |
31+
book sm
32+
ln -s -f SUMMARY.md README.md
33+
gitbook pdf
34+
gitbook epub
35+
36+
deploy:
37+
runs-on: ubuntu-latest
38+
needs: build
39+
steps:
40+
- name: Upload Release PDF Asset
41+
id: upload-release-asset
42+
uses: actions/upload-release-asset@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
45+
with:
46+
upload_url: ${{ needs.create_release.outputs.upload_url }}
47+
asset_path: book.pdf
48+
asset_name: book.pdf

0 commit comments

Comments
 (0)