-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (83 loc) · 2.41 KB
/
main.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
name: run build.py
on:
push:
branches: [master]
workflow_dispatch:
schedule:
- cron: '0 12 * * *'
env:
GIT_USER: xiaolin2004 # change to yourself
GIT_EMAIL: [email protected] # change to yourself
THEME_REPO: lfkdsk/hexo-theme-type
THEME_BRANCH: main
TEMPLATE_REPO: lfkdsk/album_template
TEMPLATE_BRANCE: main
jobs:
build:
runs-on: ubuntu-latest
environment: secrets
steps:
- name: Checkout template repo
uses: actions/checkout@v3
with:
repository: ${{ env.TEMPLATE_REPO }}
ref: ${{ env.TEMPLATE_BRANCE }}
- name: Checkout gallery repo
uses: actions/checkout@v2
with:
path: gallery
- name: Checkout public repo
uses: actions/checkout@v2
continue-on-error: true # allow error.
with:
ref: gh-pages
path: public
- name: Checkout thumbnail repo
uses: actions/checkout@v2
continue-on-error: true # allow error.
with:
ref: thumbnail
path: thumbnail_public
- name: Checkout theme repo
uses: actions/checkout@v3
with:
repository: ${{ env.THEME_REPO }}
ref: ${{ env.THEME_BRANCH }}
path: themes/hexo-theme-type
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
- run: pip install -r requirements.txt
- name: Generate Doc
run: |
echo $BASE_URL
python build.py
cat new_config.yml
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install Dependencies & Build
run: |
npm ci
npm install hexo-cli -g
hexo g --config new_config.yml
ls ./public
- name: Deploy Thumbnail
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./thumbnail_public
publish_branch: thumbnail
github_token: ${{ secrets.GH_PAGES_DEPLOY }}
user_name: ${{ env.GIT_USER }}
user_email: ${{ env.GIT_EMAIL }}
commit_msg: ${{ github.event.head_commit.message }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./public
github_token: ${{ secrets.GH_PAGES_DEPLOY }}
user_name: ${{ env.GIT_USER }}
user_email: ${{ env.GIT_EMAIL }}
commit_msg: ${{ github.event.head_commit.message }}