-
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.2 KB
/
deploy.yml
File metadata and controls
43 lines (37 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Deploy Hugo site to GitHub Pages
on:
push:
branches:
- master # mainの場合はここを書き換える
paths-ignore:
- "README.md"
- "LICENSE"
- ".gitattributes"
- ".gitignore"
- ".gitmodules"
- ".github/FUNDING.yml"
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true # テーマをサブモジュールにしてる場合
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.148.2' # 好きなHugoバージョンに変更可
extended: true # SCSS/SASSをビルドするテーマの場合はtrueにしないとエラーになる
- name: Build Hugo site
run: |
sed -i "s/\$GOOGLE_ANALYTICS_ID/${GOOGLE_ANALYTICS_ID}/g" hugo.toml
hugo --minify
env:
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages