Skip to content

Commit

Permalink
action!
Browse files Browse the repository at this point in the history
  • Loading branch information
IlichiNiKoka committed Nov 14, 2024
1 parent 68ef6be commit bd85983
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: GitHub Pages

on:
push:
branches:
- main # Set a branch to deploy
pull_request:

jobs:
deploy:
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.138.0' # 注意修改成你的hugo版本,以防兼容性错误
extended: true # 是否启用hugo extended

- name: Build
run: hugo --minify
working-directory: ./Ilichi-Blog # 注意修改成你使用hugo创建的项目名称

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
PERSONAL_TOKEN: ${{ secrets.ACTION_TOKEN }}
PUBLISH_DIR: ./Ilichi-Blog/public # 注意修改成你使用hugo创建的项目名称
EXTERNAL_REPOSITORY: IlichiNiKoka/IlichiNiKoka.github.io # 你的Github Pages远程仓库名
PUBLISH_BRANCH: main # 如果不想推送到gh-pages分支,可以添加这一行

0 comments on commit bd85983

Please sign in to comment.