Skip to content

Commit 2c50fa8

Browse files
committed
github actions設定ファイル作成
デフォルトブランチが更新される度にGitHub Pages公開用ブランチ(gh-pages)を上書き更新
1 parent 428a90d commit 2c50fa8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Hugo site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master # mainの場合はここを書き換える
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
with:
16+
submodules: true # テーマをサブモジュールにしてる場合
17+
18+
- name: Setup Hugo
19+
uses: peaceiris/actions-hugo@v3
20+
with:
21+
hugo-version: '1.12.1' # 好きなHugoバージョンに変更可
22+
23+
- name: Build Hugo site
24+
run: hugo --minify
25+
26+
- name: Deploy to GitHub Pages
27+
uses: peaceiris/actions-gh-pages@v4
28+
with:
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
publish_dir: ./public
31+
publish_branch: gh-pages

0 commit comments

Comments
 (0)