chore: 更换域名 #8
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: main | |
on: | |
push: #push即触发 | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- 'bin' | |
- 'README.md' | |
- '.env' | |
- '.gitignore' | |
- '.editorconfig' | |
- '.gitattributes' | |
- '.gitmodules' | |
jobs: | |
hugo-Deploy: | |
runs-on: ubuntu-latest #虚拟环境(github提供) | |
steps: | |
- uses: actions/checkout@v3 #官方Action, pull当前git项目 | |
with: | |
persist-credentials: false #不保存证书(当前Action的参数) | |
submodules: recursive #true OR recursive | |
fetch-depth: 0 | |
- name: Read .env | |
id: hugo-version | |
run: | #读取Hugo版本 | |
. ./.env | |
echo "HUGO_VERSION=${HUGO_VERSION}" >>$GITHUB_OUTPUT | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}' | |
extended: true | |
- name: Build | |
run: hugo --minify | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} #github会自动生成含有秘钥的环境变量 | |
publish_dir: ./public | |
publish_branch: gh-pages |