Update 2025 第一次没有回家过年.md #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Hugo Site | |
on: | |
push: | |
branches: | |
- master # 触发分支,根据你的主分支名称修改 | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # 允许写入仓库 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive # 重要!如果使用子模块主题需要此参数 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.111.0' # 指定你的 Hugo 版本 | |
extended: true # 如果需要 extended 版本 | |
- name: Build | |
run: hugo --minify # 构建命令,可根据需要添加参数 | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./ddshiyu.github.io # Hugo 默认输出目录 | |
# 如果使用 docs 目录部署,请改为: | |
# publish_dir: ./docs |