Skip to content

Merge branch 'main' of https://github.com/TRHX/spiderbox #46

Merge branch 'main' of https://github.com/TRHX/spiderbox

Merge branch 'main' of https://github.com/TRHX/spiderbox #46

name: Build and Deploy
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2 # Hugo 官方提供的 action,用于在任务环境中获取 hugo
with:
hugo-version: 'latest'
- name: Build Site
run: hugo --minify
- name: Deploy Pages
uses: peaceiris/actions-gh-pages@v3
with:
external_repository: TRHX/SpiderBOX # 发布到哪个 repo
personal_token: ${{ secrets.ACCESS_TOKEN }} # 发布到其他 repo 需要在对应的 repo 上粘贴生成的 personal_access_token
publish_dir: ./docs # 注意这里指的是 Pages 要发布哪个文件夹的内容,而不是指发布到目标仓库的什么位置;因为 hugo 默认生成静态网页到 public 文件夹,所以这里发布 public 文件夹里的内容。
publish_branch: gh-pages
full_commit_message: ${{ github.event.head_commit.message }}