From aed3a1058f0d5b5f12721052cebf8ef074fbf5ef Mon Sep 17 00:00:00 2001 From: Mitsutaka Takada Date: Sun, 19 May 2024 13:46:32 +0900 Subject: [PATCH 1/4] Update Google Analytics ID and script in analytics partial template --- layouts/partials/analytics.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 7a7225808c9ea66ea8af8f387e64e7ff73e7b601 Mon Sep 17 00:00:00 2001 From: Mitsutaka Takada Date: Sun, 19 May 2024 13:47:59 +0900 Subject: [PATCH 2/4] Update GitHub Actions workflows for separating build and deploy --- .github/workflows/gh_pages.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index 70d75760..fd35c7fb 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@v2 + 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@v2 + 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 From 39e952e11b63c72aef741db6e55c61a0527f50d5 Mon Sep 17 00:00:00 2001 From: Mitsutaka Takada Date: Sun, 19 May 2024 13:48:11 +0900 Subject: [PATCH 3/4] Update Google Analytics ID and script in analytics partial template --- config.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" From 1e07e8f9919f710c1d33c2f4521a388fb4c07fe2 Mon Sep 17 00:00:00 2001 From: Mitsutaka Takada Date: Sun, 19 May 2024 13:53:33 +0900 Subject: [PATCH 4/4] Update GitHub Actions workflows to use version 3 of actions/upload-artifact and actions/download-artifact --- .github/workflows/gh_pages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index fd35c7fb..f040cd37 100644 --- a/.github/workflows/gh_pages.yml +++ b/.github/workflows/gh_pages.yml @@ -23,7 +23,7 @@ jobs: run: hugo --minify - name: Upload build artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: public path: ./public @@ -34,7 +34,7 @@ jobs: if: github.ref == 'refs/heads/web' steps: - name: Download build artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: public path: ./public