-
Notifications
You must be signed in to change notification settings - Fork 793
87 lines (84 loc) · 2.68 KB
/
build_and_deploy.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Website Deploy
on:
push:
branches:
- master
jobs:
deploy_main:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy To Main
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Setup Docsy
run: git submodule update --init --recursive && sudo npm install -D --save autoprefixer && sudo npm install -D --save postcss-cli
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Build
env:
HUGO_ENV: production
run: hugo mod clean && hugo --minify
- name: Copy other files
run: cp .htaccess ./public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: asf-site-v2
publish_dir: ./public
keep_files: true
deploy_cn:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy To CN
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Setup Docsy
run: git submodule update --init --recursive && sudo npm install -D --save autoprefixer && sudo npm install -D --save postcss-cli
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Build
env:
HUGO_ENV: production
run: hugo mod clean && hugo --minify --config cn_config.toml
- name: Copy other files
run: cp .htaccess ./public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: cn-site
publish_dir: ./public
keep_files: true
- name: Build Benchmark
run: sh ./build_bh.sh
- name: Deploy Benchmark
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: cn-site
publish_dir: ./static
keep_files: true