Skip to content

Commit c6e039f

Browse files
committed
add hugobook
1 parent ad8a610 commit c6e039f

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/hugobook.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: hugo-book auto build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- uses: actions/checkout@v1
13+
with:
14+
submodules: true
15+
16+
# https://github.com/actions/checkout#checkout-multiple-repos-nested
17+
- name: Checkout hugo-builder
18+
uses: actions/checkout@v2
19+
with:
20+
repository: tangx/hugobook-builder
21+
path: hugobook-builder
22+
23+
- name: create blog
24+
run: |
25+
find ./ -maxdepth 2
26+
env
27+
cp -a ./docs/* hugobook-builder/content/
28+
cp README.md hugobook-builder/content/_index.md
29+
30+
- name: show env
31+
run: |
32+
env
33+
34+
- name: Setup Hugo
35+
uses: peaceiris/actions-hugo@v2
36+
with:
37+
hugo-version: '0.84.0'
38+
extended: true
39+
40+
- name: Build
41+
run: |
42+
cd hugobook-builder
43+
hugo --gc --minify --cleanDestinationDir --baseURL=https://books.tangx.in/kustz/
44+
touch public/.nojekyll
45+
46+
- name: Pushes to another repository
47+
uses: cpina/github-action-push-to-another-repository@main
48+
env:
49+
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
50+
with:
51+
source-directory: 'hugobook-builder/public'
52+
destination-github-username: 'tangx'
53+
destination-repository-name: 'hugobook'
54+
user-email: [email protected]
55+
target-branch: master
56+
target-directory: '/kustz'

0 commit comments

Comments
 (0)