From ba9ee6887a90fb2118ce8bcd408e0946b7b2df05 Mon Sep 17 00:00:00 2001 From: kyu08 <49891479+kyu08@users.noreply.github.com> Date: Sat, 25 Oct 2025 20:15:48 +0900 Subject: [PATCH 1/7] =?UTF-8?q?PR=E3=81=94=E3=81=A8=E3=81=ABPreview?= =?UTF-8?q?=E7=92=B0=E5=A2=83=E3=82=92=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview-cleanup.yaml | 25 ++++++++++++++ .github/workflows/preview.yaml | 45 ++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/preview-cleanup.yaml create mode 100644 .github/workflows/preview.yaml diff --git a/.github/workflows/preview-cleanup.yaml b/.github/workflows/preview-cleanup.yaml new file mode 100644 index 00000000..762e430d --- /dev/null +++ b/.github/workflows/preview-cleanup.yaml @@ -0,0 +1,25 @@ +name: cleanup-preview + +on: + pull_request: + types: [closed] + +jobs: + cleanup-preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Remove preview directory + run: | + if [ -d "pr-${{ github.event.pull_request.number }}" ]; then + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com + git rm -rf pr-${{ github.event.pull_request.number }} + git commit -m "Remove preview for PR #${{ github.event.pull_request.number }}" + git push + else + echo "Preview directory not found, skipping cleanup" + fi diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml new file mode 100644 index 00000000..7bee7028 --- /dev/null +++ b/.github/workflows/preview.yaml @@ -0,0 +1,45 @@ +name: deploy-preview + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: "0.115.1" + extended: true + + - name: Build + run: hugo --baseURL https://blog.kyu08.com/pr-${{ github.event.pull_request.number }}/ + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public + destination_dir: pr-${{ github.event.pull_request.number }} + keep_files: true + cname: blog.kyu08.com + + - name: Comment PR + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ github.event.pull_request.number }} + body: | + ## プレビュー環境 + + プレビュー環境が更新されました。 + + URL: https://blog.kyu08.com/pr-${{ github.event.pull_request.number }}/ + + ※ デプロイ完了まで数分かかる場合があります。 From 577ea0619a5b35955a80633e8360ef32a6b17886 Mon Sep 17 00:00:00 2001 From: kyu08 <49891479+kyu08@users.noreply.github.com> Date: Sat, 25 Oct 2025 20:17:47 +0900 Subject: [PATCH 2/7] test --- content/posts/manage-cargo-dependencies/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/posts/manage-cargo-dependencies/index.md b/content/posts/manage-cargo-dependencies/index.md index 099afdf4..cd505004 100644 --- a/content/posts/manage-cargo-dependencies/index.md +++ b/content/posts/manage-cargo-dependencies/index.md @@ -1,5 +1,5 @@ --- -title: "cargoプロジェクトで依存関係を継続的に管理する" +title: "cargoプロジェクトで依存関係を継続的に管理する222" tags: ["cargo", "rust", "OSS"] cover: "https://blog.kyu08.com/cover.png" From 72364692966cf32b89266ff6f730487e7aa1c1f5 Mon Sep 17 00:00:00 2001 From: kyu08 <49891479+kyu08@users.noreply.github.com> Date: Sat, 25 Oct 2025 20:21:10 +0900 Subject: [PATCH 3/7] =?UTF-8?q?1=E3=81=A4=E3=81=AE=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E7=B7=A8=E9=9B=86=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 7bee7028..dc75f745 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -31,15 +31,27 @@ jobs: keep_files: true cname: blog.kyu08.com - - name: Comment PR + - name: Find Comment + uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: プレビュー環境 + + - name: Create or update comment uses: peter-evans/create-or-update-comment@v3 with: + comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | ## プレビュー環境 プレビュー環境が更新されました。 - URL: https://blog.kyu08.com/pr-${{ github.event.pull_request.number }}/ + **URL:** https://blog.kyu08.com/pr-${{ github.event.pull_request.number }}/ + + **Commit:** [`${{ github.event.pull_request.head.sha }}`](${{ github.event.repository.html_url }}/commit/${{ github.event.pull_request.head.sha }}) ※ デプロイ完了まで数分かかる場合があります。 + edit-mode: replace From cb7bb5fb59fe69fd21c98df02f52910695881a09 Mon Sep 17 00:00:00 2001 From: kyu08 <49891479+kyu08@users.noreply.github.com> Date: Sat, 25 Oct 2025 20:22:43 +0900 Subject: [PATCH 4/7] test --- content/posts/fp-matsuri-2025/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/posts/fp-matsuri-2025/index.md b/content/posts/fp-matsuri-2025/index.md index abc5573f..9c387c79 100644 --- a/content/posts/fp-matsuri-2025/index.md +++ b/content/posts/fp-matsuri-2025/index.md @@ -1,5 +1,5 @@ --- -title: "関数型まつり2025に参加した" +title: "関数型まつり2025に参加し333た" tags: ["勉強会", "F#", "Rust", "Elm", "Elixir", "Ocaml" ] cover: "https://blog.kyu08.com/cover.png" From a36036571f3b1fead15dbdf8dff9eded740f16e1 Mon Sep 17 00:00:00 2001 From: kyu08 <49891479+kyu08@users.noreply.github.com> Date: Sat, 25 Oct 2025 20:24:52 +0900 Subject: [PATCH 5/7] Revert "test" This reverts commit cb7bb5fb59fe69fd21c98df02f52910695881a09. --- content/posts/fp-matsuri-2025/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/posts/fp-matsuri-2025/index.md b/content/posts/fp-matsuri-2025/index.md index 9c387c79..abc5573f 100644 --- a/content/posts/fp-matsuri-2025/index.md +++ b/content/posts/fp-matsuri-2025/index.md @@ -1,5 +1,5 @@ --- -title: "関数型まつり2025に参加し333た" +title: "関数型まつり2025に参加した" tags: ["勉強会", "F#", "Rust", "Elm", "Elixir", "Ocaml" ] cover: "https://blog.kyu08.com/cover.png" From f8258a7222c978a29323f6de0f93a578253f44ac Mon Sep 17 00:00:00 2001 From: kyu08 <49891479+kyu08@users.noreply.github.com> Date: Sat, 25 Oct 2025 20:24:53 +0900 Subject: [PATCH 6/7] Revert "test" This reverts commit 577ea0619a5b35955a80633e8360ef32a6b17886. --- content/posts/manage-cargo-dependencies/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/posts/manage-cargo-dependencies/index.md b/content/posts/manage-cargo-dependencies/index.md index cd505004..099afdf4 100644 --- a/content/posts/manage-cargo-dependencies/index.md +++ b/content/posts/manage-cargo-dependencies/index.md @@ -1,5 +1,5 @@ --- -title: "cargoプロジェクトで依存関係を継続的に管理する222" +title: "cargoプロジェクトで依存関係を継続的に管理する" tags: ["cargo", "rust", "OSS"] cover: "https://blog.kyu08.com/cover.png" From 166cf86537a5b00f4a4b80cc439d4550879de1dc Mon Sep 17 00:00:00 2001 From: kyu08 <49891479+kyu08@users.noreply.github.com> Date: Sat, 25 Oct 2025 20:25:44 +0900 Subject: [PATCH 7/7] =?UTF-8?q?concurrency=E3=81=AE=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index dc75f745..e3345f43 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -4,6 +4,10 @@ on: pull_request: types: [opened, synchronize, reopened] +concurrency: + group: preview-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: deploy-preview: runs-on: ubuntu-latest