-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 1.02 KB
/
Copy pathmain.yml
File metadata and controls
33 lines (28 loc) · 1.02 KB
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
name: Deploy Hugo
on:
push:
branches:
[main] # 主分支源代码新触发
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: latest
extended: true
- name: Build
run: hugo
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} # TOKEN 这里新建一个 https://github.com/settings/tokens
EXTERNAL_REPOSITORY: JupiterXue/JupiterXue.github.io # 部署到的仓库
PUBLISH_BRANCH: gh-pages # 推送到当前 gh-pages 分支
PUBLISH_DIR: ./public # hugo 生成到 public 作为跟目录
commit_message: ${{ github.event.head_commit.message }}