修改编译使用hugo版本 #261
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
# .github/workflows/build.yml | |
name: Deploy Hugo Site to Github Pages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: "0.73.0" | |
extended: true | |
- name: Build | |
run: hugo --minify | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.DEPLOY_KEY }} # 这里的 ACTIONS_DEPLOY_KEY 则是secrets中设置Private Key的变量名 | |
external_repository: MatNoble/matnoble.github.io # Pages 远程仓库 | |
publish_dir: ./public | |
keep_files: false # remove existing files | |
publish_branch: build # deploying branch | |
commit_message: ${{ github.event.head_commit.message }} | |
- name: Upload Algolia | |
uses: iChochy/Algolia-Upload-Records@main | |
# 设置环境变量利用secrets | |
env: | |
APPLICATION_ID: ${{secrets.APPLICATION_ID}} | |
ADMIN_API_KEY: ${{secrets.ADMIN_API_KEY}} | |
INDEX_NAME: ${{secrets.INDEX_NAME}} | |
FILE_PATH: ${{secrets.FILE_PATH}} # ./public/algolia.json | |