Skip to content

Commit 413d550

Browse files
committed
Initial commit
1 parent 07ae269 commit 413d550

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed

.github/workflows/hugo.yaml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
1-
name: Deploy Hugo site to GitHub Pages
1+
name: Build and deploy
22

33
on:
44
push:
55
branches:
6-
- main # 监听 main 分支的推送事件
7-
workflow_dispatch: # 允许手动触发
6+
- main
7+
workflow_dispatch:
88

99
permissions:
1010
contents: read
1111
pages: write
1212
id-token: write
1313

1414
concurrency:
15-
group: "pages"
15+
group: pages
1616
cancel-in-progress: false
1717

18+
defaults:
19+
run:
20+
shell: bash
21+
1822
jobs:
1923
build:
2024
runs-on: ubuntu-latest
2125
env:
22-
HUGO_VERSION: 0.156.0 # 可以指定你需要的Hugo版本
26+
HUGO_VERSION: 0.156.0
2327
steps:
2428
- name: Checkout
25-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
2630
with:
2731
submodules: recursive
28-
- name: Setup Hugo
29-
uses: peaceiris/actions-hugo@v3
30-
with:
31-
hugo-version: '${{ env.HUGO_VERSION }}'
32-
extended: true
33-
- name: Build
34-
run: hugo --minify
32+
fetch-depth: 0
33+
- name: Setup Pages
34+
id: pages
35+
uses: actions/configure-pages@v5
36+
- name: Install Hugo
37+
run: |
38+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
39+
sudo dpkg -i ${{ runner.temp }}/hugo.deb
40+
- name: Build the site
41+
run: |
42+
hugo \
43+
--gc \
44+
--minify \
45+
--baseURL "${{ steps.pages.outputs.base_url }}/"
3546
- name: Upload artifact
3647
uses: actions/upload-pages-artifact@v3
3748
with:

hugo.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: 0xdra
44
theme: ["PaperMod"]
55
defaultContentLanguage: zh
66

7+
caches:
8+
images:
9+
dir: :cacheDir/images
10+
711
languages:
812
zh:
913
weight: 1

0 commit comments

Comments
 (0)