2024-05-06 12:10:15 +08:00
|
|
|
name: HUGO-pages
|
2024-05-06 12:00:46 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main # master 更新触发
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup Hugo
|
|
|
|
uses: peaceiris/actions-hugo@v2
|
|
|
|
with:
|
|
|
|
hugo-version: latest
|
|
|
|
extended: true
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: hugo --gc --minify --cleanDestinationDir
|
|
|
|
|
|
|
|
- name: Deploy
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
2024-05-06 12:10:15 +08:00
|
|
|
personal_token: ${{ secrets.hugoblog }} # personal_token 这里新建一个 https://github.com/settings/tokens
|
2024-05-06 12:00:46 +08:00
|
|
|
PUBLISH_BRANCH: gh-pages # 推送到当前 gh-pages 分支
|
|
|
|
PUBLISH_DIR: ./public # hugo 生成到 public 作为跟目录
|
|
|
|
commit_message: ${{ github.event.head_commit.message }}
|
2024-05-06 12:10:15 +08:00
|
|
|
|
|
|
|
- name: Search
|
|
|
|
uses: caibingcheng/hugo-algolia2@v1
|
2024-05-06 12:00:46 +08:00
|
|
|
with:
|
2024-05-07 11:07:35 +08:00
|
|
|
input: "content/zh-cn/posts/**"
|
2024-05-06 12:10:15 +08:00
|
|
|
index: "blog"
|
|
|
|
apikey: ${{ secrets.ALGOLIA_WRITE_KEY }}
|
|
|
|
appid: "CIU4I6RWD0"
|