diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml
index 70d75760..f040cd37 100644
--- a/.github/workflows/gh_pages.yml
+++ b/.github/workflows/gh_pages.yml
@@ -3,27 +3,44 @@ name: github pages
on:
push:
branches:
- - web
+ - '**'
jobs:
- deploy:
+ build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
- uses: peaceiris/actions-hugo@v2
+ uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
- name: Build
run: hugo --minify
+ - name: Upload build artifacts
+ uses: actions/upload-artifact@v3
+ with:
+ name: public
+ path: ./public
+
+ deploy:
+ needs: build
+ runs-on: ubuntu-latest
+ if: github.ref == 'refs/heads/web'
+ steps:
+ - name: Download build artifacts
+ uses: actions/download-artifact@v3
+ with:
+ name: public
+ path: ./public
+
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- publish_dir: ./public
+ publish_dir: ./public
\ No newline at end of file
diff --git a/config.toml b/config.toml
index 80da4994..335ea7e4 100644
--- a/config.toml
+++ b/config.toml
@@ -4,10 +4,12 @@ title = "箱庭"
theme = "kube"
description = "IoT/クラウドロボティクス時代の仮想シミュレーション環境"
Paginate = 4
-GoogleAnalytics = "G-57DLKTNNK8"
DefaultContentLanguage = "ja"
+[Services.GoogleAnalytics]
+ ID = "G-57DLKTNNK8"
+
[languages]
[languages.ja]
languageName = "JP"
diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html
index ec3a7ec8..a5f075d3 100644
--- a/layouts/partials/analytics.html
+++ b/layouts/partials/analytics.html
@@ -1,13 +1,13 @@
{{ if not hugo.IsServer }}
-{{ with .Site.GoogleAnalytics }}
+{{ with .Site.Config.Services.GoogleAnalytics.ID }}
-
+
{{ end }}
{{ end }}
\ No newline at end of file