Skip to content

Commit 484bf49

Browse files
committed
ci: 更新部署工作流以使用新的构建目录
将输出文件从根目录移动到 `build` 目录,并更新 GitHub Pages 部署工作流以使用新的构建目录。同时,切换部署操作从 `peaceiris/actions-gh-pages` 到 `JamesIves/github-pages-deploy-action`,简化配置。
1 parent 554c36b commit 484bf49

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ jobs:
2323
run: go run main.go
2424

2525
- name: Deploy to GitHub Pages
26-
uses: peaceiris/actions-gh-pages@v4
26+
uses: JamesIves/github-pages-deploy-action@v4
2727
with:
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
29-
publish_dir: ./
30-
publish_branch: gh-pages
31-
exclude_assets: '**/*.go,**/*.json,**/*.md,.github/**'
28+
folder: build

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ func main() {
302302
log.Fatal("Error parsing template:", err)
303303
}
304304

305+
os.Mkdir("build", os.ModePerm)
306+
305307
// 创建输出文件
306-
outputFile, err := os.Create("index.html")
308+
outputFile, err := os.Create("build/index.html")
307309
if err != nil {
308310
log.Fatal("Error creating output file:", err)
309311
}

0 commit comments

Comments
 (0)