Skip to content

Commit 289cf94

Browse files
committed
250722
1 parent 1456569 commit 289cf94

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/hugo.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ jobs:
8787
path: |
8888
${{ runner.temp }}/hugo_cache
8989
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
90-
# 移除 Upload artifact 步骤,因为我们将直接推送到分支
91-
# - name: Upload artifact
92-
# uses: actions/upload-pages-artifact@v3
93-
# with:
94-
# path: ./public
90+
# 添加此步骤以将构建的站点内容作为 artifact 上传
91+
- name: Upload public directory as artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: hugo-site-public # artifact 的名称
95+
path: ./public # 要上传的目录
9596

9697
# Deployment job
9798
deploy:
@@ -107,6 +108,13 @@ jobs:
107108
submodules: recursive
108109
fetch-depth: 0 # 确保获取完整的历史记录以便推送
109110

111+
# 添加此步骤以下载构建的站点内容 artifact
112+
- name: Download public directory artifact
113+
uses: actions/download-artifact@v4
114+
with:
115+
name: hugo-site-public # 与上传时使用的 artifact 名称一致
116+
path: ./public # 下载到当前工作目录的 ./public 路径
117+
110118
- name: Configure Git
111119
run: |
112120
git config user.name "github-actions[bot]"

0 commit comments

Comments
 (0)