From 339f29c43f9aa4ede8b13eb3242bc527942ebb5e Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 13 May 2025 12:00:21 +0900 Subject: [PATCH 01/49] =?UTF-8?q?add:=20GitHub=20Pages=E3=81=B8=E3=81=AEde?= =?UTF-8?q?ploy=20pipeline=E5=8F=A9=E3=81=8D=E5=8F=B0=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/github-pages-pull-request.yml diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml new file mode 100644 index 000000000..a114127f3 --- /dev/null +++ b/.github/workflows/github-pages-pull-request.yml @@ -0,0 +1,54 @@ +name: Deploy to GitHub Pages on PR + +on: + workflow_dispatch: + pull_request: + paths-ignore: + - ".idea/**" + - ".vscode/**" + - "apps/app/**" + - "docs/**" + - "scripts/**" + - "tools/**" + - "mason.yaml" + - "**/docs/**" + - "**/test/**" + - "**.md" + +env: + PROJECT_DIR: apps/catalog + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + # https://github.com/actions/checkout + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Application Runtime + uses: ./.github/actions/setup-application-runtimet + + - name: Build web + run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/ + working-directory: ${{ env.PROJECT_DIR }} + + # # https://github.com/actions/upload-pages-artifact + # - name: Upload static files as artifact + # id: deployment + # uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + # with: + # path: ${{ env.PROJECT_DIR }}/build/web + + +# deploy: +# environment: +# name: github-pages +# url: ${{ steps.deployment.outputs.page_url }} +# runs-on: ubuntu-22.04 +# needs: build +# steps: +# # https://github.com/actions/deploy-pages +# - name: Deploy to GitHub Pages +# id: deployment +# uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 From b4297bf8b1e9a91e803c888be0a78c361b650832 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 13 May 2025 12:17:51 +0900 Subject: [PATCH 02/49] =?UTF-8?q?chore:=20typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index a114127f3..b18b1bb46 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Application Runtime - uses: ./.github/actions/setup-application-runtimet + uses: ./.github/actions/setup-application-runtime - name: Build web run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/ From f8c4d0ec2cc18f3aedd1a553d187d201552b8d9a Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 13 May 2025 13:05:15 +0900 Subject: [PATCH 03/49] =?UTF-8?q?add:=20=E9=96=93=E9=81=95=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E5=AE=9F=E8=A1=8C=E6=99=82=E3=81=AB=E3=83=87=E3=83=97?= =?UTF-8?q?=E3=83=AD=E3=82=A4=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E5=88=B6=E9=99=90=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index b18b1bb46..89e5d208d 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -21,6 +21,8 @@ env: jobs: build: runs-on: ubuntu-22.04 + # NOTE: See https://github.com/yumemi-inc/flutter-mobile-project-template/blob/main/docs/GITHUB_PAGES_PREVIEW.md + if: github.event.repository.name == 'flutter-mobile-project-template' steps: # https://github.com/actions/checkout - name: Checkout From db269092af3ba1000077e793c582a186d7d579fa Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 13 May 2025 14:44:19 +0900 Subject: [PATCH 04/49] =?UTF-8?q?add:=20GitHub=20Pages=E3=81=AE=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E3=83=89=E3=82=AD?= =?UTF-8?q?=E3=83=A5=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../initialization/ja/GITHUB_PAGES_PREVIEW.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/initialization/ja/GITHUB_PAGES_PREVIEW.md diff --git a/.github/initialization/ja/GITHUB_PAGES_PREVIEW.md b/.github/initialization/ja/GITHUB_PAGES_PREVIEW.md new file mode 100644 index 000000000..e41ce4515 --- /dev/null +++ b/.github/initialization/ja/GITHUB_PAGES_PREVIEW.md @@ -0,0 +1,32 @@ +# GitHub Pages プレビュー + +この Issue の対応は任意です。 + +このプロジェクトでは `apps/catalog` の Widgetbook を PullRequest 時にプレビューできるようにするワークフローが用意されています。 +プレビューは GitHub Pages 上にデプロイされます。 + +ワークフローを有効化するためには、以下の手順に従って設定してください。 + +## 1. カスタム GitHub Actions ワークフローによる公開設定 + +[ドキュメント][1] に従ってGitHub Actions ワークフローでGitHub Pageにデプロイ可能にする。 + +## 2. Visibilityの有効化 + +[ドキュメント][2] に従って`Visibility`を有効化することにより、アクセス制限を設定する。 + +## 3. ワークフローの内容を変更する + +`.github/workflows/firebase-hosting-pull-request.yaml` を修正する。 + +### 3-1. リポジトリ名条件の削除 + +このテンプレートプロジェクトを元に新規プロジェクトを作成した際に、誤ってワークフローが実行されないように、リポジトリ名による有効化条件を記述しています。この記述はセットアップ後は不要になりますので、削除してください。 + +![firebase-hosting-preview-02.png](https://github.com/user-attachments/assets/04475d96-986d-44de-b945-25c4308b5d26) + + + +[1]: https://docs.github.com/ja/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0-github-actions-%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E3%81%AB%E3%82%88%E3%82%8B%E5%85%AC%E9%96%8B + +[2]: https://docs.github.com/ja/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site From 6b8bedf179baab99c69a11483a820aabe27f0fe1 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 13 May 2025 14:53:00 +0900 Subject: [PATCH 05/49] =?UTF-8?q?chore:=20=E6=9B=B8=E3=81=8D=E6=8F=9B?= =?UTF-8?q?=E3=81=88=E5=BF=98=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/initialization/ja/GITHUB_PAGES_PREVIEW.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/initialization/ja/GITHUB_PAGES_PREVIEW.md b/.github/initialization/ja/GITHUB_PAGES_PREVIEW.md index e41ce4515..c35fea216 100644 --- a/.github/initialization/ja/GITHUB_PAGES_PREVIEW.md +++ b/.github/initialization/ja/GITHUB_PAGES_PREVIEW.md @@ -17,13 +17,13 @@ ## 3. ワークフローの内容を変更する -`.github/workflows/firebase-hosting-pull-request.yaml` を修正する。 +`.github/workflows/github-pages-pull-request.yml` を修正する。 ### 3-1. リポジトリ名条件の削除 このテンプレートプロジェクトを元に新規プロジェクトを作成した際に、誤ってワークフローが実行されないように、リポジトリ名による有効化条件を記述しています。この記述はセットアップ後は不要になりますので、削除してください。 -![firebase-hosting-preview-02.png](https://github.com/user-attachments/assets/04475d96-986d-44de-b945-25c4308b5d26) +![github-pages-pull-request.png](https://github.com/user-attachments/assets/04475d96-986d-44de-b945-25c4308b5d26) From 82249f2ca3bb26c940dd86726d3da0a6a6d00478 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 13 May 2025 14:56:12 +0900 Subject: [PATCH 06/49] =?UTF-8?q?delete:=20firebase=20hosting=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action.yaml | 2 +- .../en/FIREBASE_HOSTING_PREVIEW.md | 114 ------------------ .../ja/FIREBASE_HOSTING_PREVIEW.md | 112 ----------------- .../firebase-hosting-pull-request.yaml | 51 -------- 4 files changed, 1 insertion(+), 278 deletions(-) delete mode 100644 .github/initialization/en/FIREBASE_HOSTING_PREVIEW.md delete mode 100644 .github/initialization/ja/FIREBASE_HOSTING_PREVIEW.md delete mode 100644 .github/workflows/firebase-hosting-pull-request.yaml diff --git a/.github/actions/create-issue-at-initialization/action.yaml b/.github/actions/create-issue-at-initialization/action.yaml index 7e78463ec..ae0e12e43 100644 --- a/.github/actions/create-issue-at-initialization/action.yaml +++ b/.github/actions/create-issue-at-initialization/action.yaml @@ -43,7 +43,7 @@ runs: - uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # v5.0.0 with: title: "[初期セットアップ(任意)] Pull Request内でデプロイのワークフローを設定する" - content-filepath: .github/initialization/${{ inputs.language }}/FIREBASE_HOSTING_PREVIEW.md + content-filepath: .github/initialization/${{ inputs.language }}/GITHUB_PAGES_PREVIEW.md labels: | initialization optional diff --git a/.github/initialization/en/FIREBASE_HOSTING_PREVIEW.md b/.github/initialization/en/FIREBASE_HOSTING_PREVIEW.md deleted file mode 100644 index b1c491695..000000000 --- a/.github/initialization/en/FIREBASE_HOSTING_PREVIEW.md +++ /dev/null @@ -1,114 +0,0 @@ -# Firebase Hosting Preview - -Response to this Issue is optional. - -This project has a workflow to make the `apps/catalog` widgetbook available for preview on PullRequest. -The preview will be deployed on Firebase. - -To activate the workflow, please follow these steps. - -![firebase-hosting-preview-01.png](https://github.com/user-attachments/assets/f77a9a75-a75f-4fb2-a469-0b0346c1f9cd) - -## 1. Create Firebase project - -Create a Firebase project according to the [documentation][1]. - -## 2. Initialize Firebase Hosting - -Initialize Firebase Hosting according to the [documentation][2]. - -## 3. Update the project's Firebase Hosting settings - -Execute the following command - -```shell -firebase init hosting:github -``` - -Complete the setup using the following output as a reference - -```shell -$ firebase init hosting:github - - ######## #### ######## ######## ######## ### ###### ######## - ## ## ## ## ## ## ## ## ## ## ## - ###### ## ######## ###### ######## ######### ###### ###### - ## ## ## ## ## ## ## ## ## ## ## - ## #### ## ## ######## ######## ## ## ###### ######## - -You're about to initialize a Firebase project in this directory: - -Before we get started, keep in mind: - - * You are initializing within an existing Firebase project directory - - -=== Project Setup - -First, let's associate this project directory with a Firebase project. -You can create multiple project aliases by running firebase use --add, -but for now we'll just set up a default project. - -i Using project flutter-project - -=== Hosting:github Setup - -i Detected a .git folder at /path -i Authorizing with GitHub to upload your service account to a GitHub repository's secrets store. - -Visit this URL on this device to log in: -https://github.com/login/oauth/authorize?client_id= - -Waiting for authentication... - -✔ Success! Logged into GitHub as username - -? For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository) username/repository - -✔ Created service account github-action-XXXXXXXXX with Firebase Hosting admin permissions. -✔ Uploaded service account JSON to GitHub as secret FIREBASE_SERVICE_ACCOUNT_XXXX. -i You can manage your secrets at https://github.com/username/repository/settings/secrets. - -? Set up the workflow to run a build script before every deploy? No -? GitHub workflow file for PR previews exists. Overwrite? firebase-hosting-pull-request.yml No -? Set up automatic deployment to your site's live channel when a PR is merged? No - -i Action required: Visit this URL to revoke authorization for the Firebase CLI GitHub OAuth App: -https://github.com/settings/connections/applications/89cf50f02ac6aaed3484 -i Action required: Push any new workflow file(s) to your repo - -i Writing configuration info to firebase.json... -i Writing project information to .firebaserc... - -✔ Firebase initialization complete! -``` - -## 4. Change workflow content - -Modify `.github/workflows/firebase-hosting-pull-request.yaml`. - -### 4-1. Remove repository name condition - -To avoid inadvertent execution of the workflow when a new project is created based on this template project, we have -included an activation condition by repository name. -This description is no longer needed during setup, so please delete it. - -![firebase-hosting-preview-02.png](https://github.com/user-attachments/assets/04475d96-986d-44de-b945-25c4308b5d26) - -### 4-2. Change Firebase Service Account name - -Replace with the name of the Firebase Service Account created by the `firebase init hosting:github` command. - -![firebase-hosting-preview-03.png](https://github.com/user-attachments/assets/89246f05-b099-4f46-9308-de3063704258) - -### 4-3. Change projectId to the ID of the relevant project - -Replace the Firebase project. - -![firebase-hosting-preview-04.png](https://github.com/user-attachments/assets/b36cc6e3-fa83-4c61-a55f-59c4e7c0e5e6) - - - -[1]: https://firebase.google.com/docs/web/setup - -[2]: https://firebase.google.com/docs/hosting/quickstart diff --git a/.github/initialization/ja/FIREBASE_HOSTING_PREVIEW.md b/.github/initialization/ja/FIREBASE_HOSTING_PREVIEW.md deleted file mode 100644 index ddd357df2..000000000 --- a/.github/initialization/ja/FIREBASE_HOSTING_PREVIEW.md +++ /dev/null @@ -1,112 +0,0 @@ -# Firebase Hosting プレビュー - -この Issue の対応は任意です。 - -このプロジェクトでは `apps/catalog` の Widgetbook を PullRequest 時にプレビューできるようにするワークフローが用意されています。 -プレビューは Firebase 上にデプロイされます。 - -ワークフローを有効化するためには、以下の手順に従って設定してください。 - -![firebase-hosting-preview-01.png](https://github.com/user-attachments/assets/f77a9a75-a75f-4fb2-a469-0b0346c1f9cd) - -## 1. 新規Firebaseプロジェクトの作成 - -[ドキュメント][1] に従ってFirebaseプロジェクトを作成します。 - -## 2. Firebase Hosting の初期化 - -[ドキュメント][2] に従ってFirebase Hostingを初期化します。 - -## 3.プロジェクトのFirebase Hosting 設定を更新する - -以下のコマンドを実行する。 - -```shell -firebase init hosting:github -``` - -以下の出力を参考にセットアップを完了する。 - -```shell -$ firebase init hosting:github - - ######## #### ######## ######## ######## ### ###### ######## - ## ## ## ## ## ## ## ## ## ## ## - ###### ## ######## ###### ######## ######### ###### ###### - ## ## ## ## ## ## ## ## ## ## ## - ## #### ## ## ######## ######## ## ## ###### ######## - -You're about to initialize a Firebase project in this directory: - -Before we get started, keep in mind: - - * You are initializing within an existing Firebase project directory - - -=== Project Setup - -First, let's associate this project directory with a Firebase project. -You can create multiple project aliases by running firebase use --add, -but for now we'll just set up a default project. - -i Using project flutter-project - -=== Hosting:github Setup - -i Detected a .git folder at /path -i Authorizing with GitHub to upload your service account to a GitHub repository's secrets store. - -Visit this URL on this device to log in: -https://github.com/login/oauth/authorize?client_id= - -Waiting for authentication... - -✔ Success! Logged into GitHub as username - -? For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository) username/repository - -✔ Created service account github-action-XXXXXXXXX with Firebase Hosting admin permissions. -✔ Uploaded service account JSON to GitHub as secret FIREBASE_SERVICE_ACCOUNT_XXXX. -i You can manage your secrets at https://github.com/username/repository/settings/secrets. - -? Set up the workflow to run a build script before every deploy? No -? GitHub workflow file for PR previews exists. Overwrite? firebase-hosting-pull-request.yml No -? Set up automatic deployment to your site's live channel when a PR is merged? No - -i Action required: Visit this URL to revoke authorization for the Firebase CLI GitHub OAuth App: -https://github.com/settings/connections/applications/89cf50f02ac6aaed3484 -i Action required: Push any new workflow file(s) to your repo - -i Writing configuration info to firebase.json... -i Writing project information to .firebaserc... - -✔ Firebase initialization complete! -``` - -## 4. ワークフローの内容を変更する - -`.github/workflows/firebase-hosting-pull-request.yaml` を修正する。 - -### 4-1. リポジトリ名条件の削除 - -このテンプレートプロジェクトを元に新規プロジェクトを作成した際に、誤ってワークフローが実行されないように、リポジトリ名による有効化条件を記述しています。この記述はセットアップ後は不要になりますので、削除してください。 - -![firebase-hosting-preview-02.png](https://github.com/user-attachments/assets/04475d96-986d-44de-b945-25c4308b5d26) - -### 4-2. Firebase Service Account名の変更 - -`firebase init hosting:github`コマンドで作成したFirebaseサービスアカウント名に置き換えてください。 - -![firebase-hosting-preview-03.png](https://github.com/user-attachments/assets/89246f05-b099-4f46-9308-de3063704258) - -### 4-3. projectIdを該当プロジェクトのIDに変更する - -Firebaseプロジェクトを置き換える。 - -![firebase-hosting-preview-04.png](https://github.com/user-attachments/assets/b36cc6e3-fa83-4c61-a55f-59c4e7c0e5e6) - - - -[1]: https://firebase.google.com/docs/web/setup - -[2]: https://firebase.google.com/docs/hosting/quickstart diff --git a/.github/workflows/firebase-hosting-pull-request.yaml b/.github/workflows/firebase-hosting-pull-request.yaml deleted file mode 100644 index 303772220..000000000 --- a/.github/workflows/firebase-hosting-pull-request.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# This file was auto-generated by the Firebase CLI -# https://github.com/firebase/firebase-tools - -name: Deploy to Firebase Hosting on PR - -on: - workflow_dispatch: - pull_request: - paths-ignore: - - ".idea/**" - - ".vscode/**" - - "apps/app/**" - - "docs/**" - - "scripts/**" - - "tools/**" - - "mason.yaml" - - "**/docs/**" - - "**/test/**" - - "**.md" - -jobs: - build-and-preview: - runs-on: ubuntu-22.04 - # NOTE: See https://github.com/yumemi-inc/flutter-mobile-project-template/blob/main/docs/FIREBASE_HOSTING_PREVIEW.md - if: github.event.repository.name == 'flutter-mobile-project-template' - permissions: - checks: write - contents: read - pull-requests: write - steps: - # https://github.com/actions/checkout - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Setup Application Runtime - uses: ./.github/actions/setup-application-runtime - - - name: Setup Node - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 - with: - node-version: 20 - - # https://github.com/marketplace/actions/deploy-to-firebase-hosting - - uses: FirebaseExtended/action-hosting-deploy@0cbcac4740c2bfb00d632f0b863b57713124eb5a # v0.9.0 - with: - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: >- - ${{ secrets.FIREBASE_SERVICE_ACCOUNT_YUMEMI_FLUTTER_MOBILE_TEMPLATE }} - projectId: "yumemi-flutter-mobile-template" - env: - FIREBASE_CLI_EXPERIMENTS: webframeworks From 300c6bada9c2cd86a5bcaad32692017bad8d2ff1 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 13 May 2025 15:24:32 +0900 Subject: [PATCH 07/49] =?UTF-8?q?permission&timeout-minutes=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 89e5d208d..7031ef1f8 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -20,6 +20,7 @@ env: jobs: build: + timeout-minutes: 5 runs-on: ubuntu-22.04 # NOTE: See https://github.com/yumemi-inc/flutter-mobile-project-template/blob/main/docs/GITHUB_PAGES_PREVIEW.md if: github.event.repository.name == 'flutter-mobile-project-template' @@ -35,22 +36,26 @@ jobs: run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/ working-directory: ${{ env.PROJECT_DIR }} - # # https://github.com/actions/upload-pages-artifact - # - name: Upload static files as artifact - # id: deployment - # uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 - # with: - # path: ${{ env.PROJECT_DIR }}/build/web + # # https://github.com/actions/upload-pages-artifact + # - name: Upload static files as artifact + # id: deployment + # uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + # with: + # path: ${{ env.PROJECT_DIR }}/build/web -# deploy: -# environment: -# name: github-pages -# url: ${{ steps.deployment.outputs.page_url }} -# runs-on: ubuntu-22.04 -# needs: build -# steps: -# # https://github.com/actions/deploy-pages -# - name: Deploy to GitHub Pages -# id: deployment -# uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 + # deploy: + # environment: + # name: github-pages + # url: ${{ steps.deployment.outputs.page_url }} + # permissions: + # pages: write + # id-token: write + # timeout-minutes: 5 + # runs-on: ubuntu-22.04 + # needs: build + # steps: + # # https://github.com/actions/deploy-pages + # - name: Deploy to GitHub Pages + # id: deployment + # uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 From 77d543855f679ce3c4246ff3c28ed3a69f874ba3 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 13 May 2025 15:29:54 +0900 Subject: [PATCH 08/49] =?UTF-8?q?chore:=20=E6=84=8F=E5=9B=B3=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=BD=A2=E3=81=A7=E5=AE=9F=E8=A1=8C=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B=E7=82=BA=E3=80=81on=E3=82=92=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=A2=E3=82=A6=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 7031ef1f8..2a4a1b127 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -1,19 +1,19 @@ name: Deploy to GitHub Pages on PR -on: - workflow_dispatch: - pull_request: - paths-ignore: - - ".idea/**" - - ".vscode/**" - - "apps/app/**" - - "docs/**" - - "scripts/**" - - "tools/**" - - "mason.yaml" - - "**/docs/**" - - "**/test/**" - - "**.md" +# on: +# workflow_dispatch: +# pull_request: +# paths-ignore: +# - ".idea/**" +# - ".vscode/**" +# - "apps/app/**" +# - "docs/**" +# - "scripts/**" +# - "tools/**" +# - "mason.yaml" +# - "**/docs/**" +# - "**/test/**" +# - "**.md" env: PROJECT_DIR: apps/catalog From 0e49b1554921bed44f5d044da8347a95f8f25995 Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 19 May 2025 10:35:39 +0900 Subject: [PATCH 09/49] =?UTF-8?q?chore:=20=E3=83=89=E3=82=AD=E3=83=A5?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E3=81=ABPages=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E6=B3=A8=E6=84=8F=E4=BA=8B=E9=A0=85=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/initialization/GITHUB_PAGES_PREVIEW.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/initialization/GITHUB_PAGES_PREVIEW.md b/.github/initialization/GITHUB_PAGES_PREVIEW.md index c35fea216..9950c1e76 100644 --- a/.github/initialization/GITHUB_PAGES_PREVIEW.md +++ b/.github/initialization/GITHUB_PAGES_PREVIEW.md @@ -9,11 +9,18 @@ ## 1. カスタム GitHub Actions ワークフローによる公開設定 -[ドキュメント][1] に従ってGitHub Actions ワークフローでGitHub Pageにデプロイ可能にする。 +[カスタム GitHub Actions ワークフローによる公開][1] に従ってGitHub Actions ワークフローでGitHub Pageにデプロイ可能にする。 ## 2. Visibilityの有効化 -[ドキュメント][2] に従って`Visibility`を有効化することにより、アクセス制限を設定する。 +[GitHub Pages サイトの可視性を変更する][2] に従って`Visibility`を有効化することにより、アクセス制限を設定する。 +ただし、この機能は`GitHub Enterprise Cloud`を契約している`Organization`でしか利用できません。 +`GitHub Enterprise Cloud`以外で非公開のデプロイを行いたい場合、 + +- `AWS CloudFront` +- `Cloudflare Pages` + `Zero Trust` + +等を検討してください。 ## 3. ワークフローの内容を変更する From 11b6654c10c3af5417dc1aa8bb2f4c5e96e55558 Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 19 May 2025 10:39:55 +0900 Subject: [PATCH 10/49] =?UTF-8?q?chore:=20repository=20owner=20=E3=82=92?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 2a4a1b127..729c7f54b 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 5 runs-on: ubuntu-22.04 # NOTE: See https://github.com/yumemi-inc/flutter-mobile-project-template/blob/main/docs/GITHUB_PAGES_PREVIEW.md - if: github.event.repository.name == 'flutter-mobile-project-template' + if: ${{ github.repository_owner == 'yumemi-inc' && github.event.repository.name == 'flutter-mobile-project-template' }} steps: # https://github.com/actions/checkout - name: Checkout From 8ab57942c980b6bc4e4b6521dbf1fbc03429283c Mon Sep 17 00:00:00 2001 From: Ryo24 <40818362+r0227n@users.noreply.github.com> Date: Mon, 19 May 2025 10:55:50 +0900 Subject: [PATCH 11/49] Update GITHUB_PAGES_PREVIEW.md image --- .github/initialization/GITHUB_PAGES_PREVIEW.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/initialization/GITHUB_PAGES_PREVIEW.md b/.github/initialization/GITHUB_PAGES_PREVIEW.md index 9950c1e76..684bec730 100644 --- a/.github/initialization/GITHUB_PAGES_PREVIEW.md +++ b/.github/initialization/GITHUB_PAGES_PREVIEW.md @@ -30,7 +30,8 @@ このテンプレートプロジェクトを元に新規プロジェクトを作成した際に、誤ってワークフローが実行されないように、リポジトリ名による有効化条件を記述しています。この記述はセットアップ後は不要になりますので、削除してください。 -![github-pages-pull-request.png](https://github.com/user-attachments/assets/04475d96-986d-44de-b945-25c4308b5d26) +![github-pages-pull-request.png](https://github.com/user-attachments/assets/324da9ca-078d-4b8f-a7bc-b6441c2c8564) + From 7dd9f222075486c5783cfc3cd2783c85aaf32818 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 20 May 2025 14:22:19 +0900 Subject: [PATCH 12/49] =?UTF-8?q?chore:=20=E3=82=B3=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=82=A2=E3=82=A6=E3=83=88=E3=82=92=E8=A7=A3=E9=99=A4?= =?UTF-8?q?=E3=81=97=E3=80=81=E3=83=87=E3=83=97=E3=83=AD=E3=82=A4=E3=81=AE?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D=E5=8F=AF=E8=83=BD=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 729c7f54b..ea3cec791 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -1,19 +1,19 @@ name: Deploy to GitHub Pages on PR -# on: -# workflow_dispatch: -# pull_request: -# paths-ignore: -# - ".idea/**" -# - ".vscode/**" -# - "apps/app/**" -# - "docs/**" -# - "scripts/**" -# - "tools/**" -# - "mason.yaml" -# - "**/docs/**" -# - "**/test/**" -# - "**.md" +on: + workflow_dispatch: + pull_request: + paths-ignore: + - ".idea/**" + - ".vscode/**" + - "apps/app/**" + - "docs/**" + - "scripts/**" + - "tools/**" + - "mason.yaml" + - "**/docs/**" + - "**/test/**" + - "**.md" env: PROJECT_DIR: apps/catalog @@ -36,26 +36,26 @@ jobs: run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/ working-directory: ${{ env.PROJECT_DIR }} - # # https://github.com/actions/upload-pages-artifact - # - name: Upload static files as artifact - # id: deployment - # uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 - # with: - # path: ${{ env.PROJECT_DIR }}/build/web + # https://github.com/actions/upload-pages-artifact + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + with: + path: ${{ env.PROJECT_DIR }}/build/web - # deploy: - # environment: - # name: github-pages - # url: ${{ steps.deployment.outputs.page_url }} - # permissions: - # pages: write - # id-token: write - # timeout-minutes: 5 - # runs-on: ubuntu-22.04 - # needs: build - # steps: - # # https://github.com/actions/deploy-pages - # - name: Deploy to GitHub Pages - # id: deployment - # uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + permissions: + pages: write + id-token: write + timeout-minutes: 5 + runs-on: ubuntu-22.04 + needs: build + steps: + # https://github.com/actions/deploy-pages + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 From b4f31452c6ea43d500111de6273f3a83e7ef3d1f Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 20 May 2025 14:29:49 +0900 Subject: [PATCH 13/49] =?UTF-8?q?fix:=20fomat=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/initialization/GITHUB_PAGES_PREVIEW.md | 2 -- .github/workflows/github-pages-pull-request.yml | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/initialization/GITHUB_PAGES_PREVIEW.md b/.github/initialization/GITHUB_PAGES_PREVIEW.md index 684bec730..bab6d5601 100644 --- a/.github/initialization/GITHUB_PAGES_PREVIEW.md +++ b/.github/initialization/GITHUB_PAGES_PREVIEW.md @@ -32,9 +32,7 @@ ![github-pages-pull-request.png](https://github.com/user-attachments/assets/324da9ca-078d-4b8f-a7bc-b6441c2c8564) - [1]: https://docs.github.com/ja/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0-github-actions-%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E3%81%AB%E3%82%88%E3%82%8B%E5%85%AC%E9%96%8B - [2]: https://docs.github.com/ja/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index ea3cec791..2639601f2 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -42,8 +42,7 @@ jobs: uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ${{ env.PROJECT_DIR }}/build/web - - + deploy: environment: name: github-pages From 166d61542776d9a69f20316ad6fb7190e824d4c8 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 20 May 2025 15:15:35 +0900 Subject: [PATCH 14/49] =?UTF-8?q?add:=20Deployment=20branches=20and=20tags?= =?UTF-8?q?=20=E3=81=AE=E8=A8=AD=E5=AE=9A=E9=A0=85=E7=9B=AE=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/initialization/GITHUB_PAGES_PREVIEW.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/initialization/GITHUB_PAGES_PREVIEW.md b/.github/initialization/GITHUB_PAGES_PREVIEW.md index bab6d5601..787639b3e 100644 --- a/.github/initialization/GITHUB_PAGES_PREVIEW.md +++ b/.github/initialization/GITHUB_PAGES_PREVIEW.md @@ -22,11 +22,24 @@ 等を検討してください。 -## 3. ワークフローの内容を変更する +## 3. デプロイ環境の設定確認 + +`GitHub Pages`へデプロイ可能なブランチを制限します。 +`Settings` ⇨ `Environments`から`github-pages`環境を選択し、デプロイ可能なブランチを指定してください。 + +`Deployment branches and tags`では、以下の3つのオプションからプロジェクトに適した設定を選択できます: + +- `No restriction`: すべてのブランチからデプロイ可能 +- `Protected branches only`: 保護されたブランチからのみデプロイ可能 +- `Selected branches and tags`: 指定したブランチやタグパターンに一致するもののみデプロイ可能 + +セキュリティ要件や運用方針に応じて、適切な制限を設定することをお勧めします。 + +## 4. ワークフローの内容を変更する `.github/workflows/github-pages-pull-request.yml` を修正する。 -### 3-1. リポジトリ名条件の削除 +### 4-1. リポジトリ名条件の削除 このテンプレートプロジェクトを元に新規プロジェクトを作成した際に、誤ってワークフローが実行されないように、リポジトリ名による有効化条件を記述しています。この記述はセットアップ後は不要になりますので、削除してください。 From 01d8a72d697a73f4e18d80f0774ac1cb04a5bc88 Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 28 May 2025 15:13:37 +0900 Subject: [PATCH 15/49] =?UTF-8?q?add:=20concurrency=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 2639601f2..f168fadcd 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -15,6 +15,10 @@ on: - "**/test/**" - "**.md" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: PROJECT_DIR: apps/catalog From 235cc01eb1b5b00c749d35915198f4d55045648f Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 28 May 2025 17:27:37 +0900 Subject: [PATCH 16/49] =?UTF-8?q?chore:=20domain//?= =?UTF-8?q?=E5=BD=A2=E5=BC=8F=E3=81=A7=E3=83=87=E3=83=97=E3=83=AD=E3=82=A4?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index f168fadcd..94f25c913 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -21,6 +21,8 @@ concurrency: env: PROJECT_DIR: apps/catalog + DEPLOY_BRANCH: github-pages + DEPLOY_DIR: ${{ github.event.number }}/${{ github.sha }} jobs: build: @@ -40,20 +42,31 @@ jobs: run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/ working-directory: ${{ env.PROJECT_DIR }} + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ env.DEPLOY_BRANCH }} + + - name: Move build/web to ${{ env.DEPLOY_DIR }} + run: | + mkdir -p ${{ env.DEPLOY_DIR }} + mv ${{ env.PROJECT_DIR }}/build/web/* ${{ env.DEPLOY_DIR }}/ + # https://github.com/actions/upload-pages-artifact - name: Upload static files as artifact id: deployment uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: - path: ${{ env.PROJECT_DIR }}/build/web + path: ${{ env.DEPLOY_DIR }}/ deploy: environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + url: ${{ steps.deployment.outputs.page_url }}/${{ env.DEPLOY_DIR }}/ permissions: pages: write id-token: write + pull-requests: write timeout-minutes: 5 runs-on: ubuntu-22.04 needs: build @@ -62,3 +75,10 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 + + - name: Comment + if: ${{ steps.deployment.outputs.page_url != '' }} + run: | + gh pr comment "${{ github.event.pull_request.number }}" --body "Deployed to GitHub Pages: ${{ steps.deployment.outputs.page_url }}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d807cb1b87b85ad475c149595819f28f564df202 Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 28 May 2025 17:55:18 +0900 Subject: [PATCH 17/49] =?UTF-8?q?chore:=20branch=E3=82=92=E5=88=86?= =?UTF-8?q?=E3=81=91=E3=81=9A=E3=80=81=E7=9B=B4=E6=8E=A5deploy=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 94f25c913..a4b9c8f19 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -21,7 +21,6 @@ concurrency: env: PROJECT_DIR: apps/catalog - DEPLOY_BRANCH: github-pages DEPLOY_DIR: ${{ github.event.number }}/${{ github.sha }} jobs: @@ -42,22 +41,12 @@ jobs: run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/ working-directory: ${{ env.PROJECT_DIR }} - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ env.DEPLOY_BRANCH }} - - - name: Move build/web to ${{ env.DEPLOY_DIR }} - run: | - mkdir -p ${{ env.DEPLOY_DIR }} - mv ${{ env.PROJECT_DIR }}/build/web/* ${{ env.DEPLOY_DIR }}/ - # https://github.com/actions/upload-pages-artifact - name: Upload static files as artifact id: deployment uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: - path: ${{ env.DEPLOY_DIR }}/ + path: ${{ env.PROJECT_DIR }}/build/web deploy: environment: From 45b93fdfd1b4e200291a3df2ed91ce26b943bc84 Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 28 May 2025 18:03:45 +0900 Subject: [PATCH 18/49] =?UTF-8?q?chore:=20checkout=20=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index a4b9c8f19..9b73c9c74 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -65,6 +65,10 @@ jobs: id: deployment uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 + # https://github.com/actions/checkout + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Comment if: ${{ steps.deployment.outputs.page_url != '' }} run: | From 12b023752662753459bceb6f04eb0e078ab7592a Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 28 May 2025 18:19:39 +0900 Subject: [PATCH 19/49] =?UTF-8?q?chore:=20url=E3=81=AE=E6=9C=AB=E5=B0=BE?= =?UTF-8?q?=E3=81=AE/=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 9b73c9c74..f92513fb6 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -51,11 +51,10 @@ jobs: deploy: environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }}/${{ env.DEPLOY_DIR }}/ + url: ${{ steps.deployment.outputs.page_url }}${{ env.DEPLOY_DIR }} permissions: pages: write id-token: write - pull-requests: write timeout-minutes: 5 runs-on: ubuntu-22.04 needs: build @@ -64,14 +63,3 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 - - # https://github.com/actions/checkout - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Comment - if: ${{ steps.deployment.outputs.page_url != '' }} - run: | - gh pr comment "${{ github.event.pull_request.number }}" --body "Deployed to GitHub Pages: ${{ steps.deployment.outputs.page_url }}" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1d492bd1881210549cba7c0905ca22f0fe68cac4 Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 28 May 2025 18:37:11 +0900 Subject: [PATCH 20/49] =?UTF-8?q?chore:=20base-href=20=E3=81=ABDEPLOY=5FDI?= =?UTF-8?q?R=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index f92513fb6..7137b56e4 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -38,7 +38,7 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: Build web - run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/ + run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }} working-directory: ${{ env.PROJECT_DIR }} # https://github.com/actions/upload-pages-artifact From 3cf876f49a73f6fbc737f3a2604f968905c2e827 Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 28 May 2025 18:40:25 +0900 Subject: [PATCH 21/49] =?UTF-8?q?fix:=20base-href=20=E3=81=AE=E6=9C=AB?= =?UTF-8?q?=E5=B0=BE=E3=81=AB/=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 7137b56e4..8f61f065f 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -38,7 +38,7 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: Build web - run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }} + run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ working-directory: ${{ env.PROJECT_DIR }} # https://github.com/actions/upload-pages-artifact From 4831844f6f8817349327aa0f758c6d6fce3e842c Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 28 May 2025 18:57:09 +0900 Subject: [PATCH 22/49] =?UTF-8?q?add:=20404=E3=82=92=E3=82=B3=E3=83=94?= =?UTF-8?q?=E3=83=BC=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8Bstep=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 8f61f065f..501daef1d 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -41,6 +41,10 @@ jobs: run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ working-directory: ${{ env.PROJECT_DIR }} + - name: Copy index.html to 404.html for client-side routing + run: cp index.html 404.html + working-directory: ${{ env.PROJECT_DIR }}/build/web + # https://github.com/actions/upload-pages-artifact - name: Upload static files as artifact id: deployment From d67ea002845bbc3c30b8249434564566c4bc020f Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 09:14:53 +0900 Subject: [PATCH 23/49] =?UTF-8?q?chore:=20sha=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 501daef1d..8aac60066 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -21,7 +21,7 @@ concurrency: env: PROJECT_DIR: apps/catalog - DEPLOY_DIR: ${{ github.event.number }}/${{ github.sha }} + DEPLOY_DIR: ${{ github.event.number }} jobs: build: From 65ffb4eb11f182787f12b50a3a3b7401a71ea393 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 11:09:05 +0900 Subject: [PATCH 24/49] =?UTF-8?q?chore:=20wasm=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 8aac60066..12736d4d4 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -38,7 +38,7 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: Build web - run: flutter build web --release --wasm --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ + run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ working-directory: ${{ env.PROJECT_DIR }} - name: Copy index.html to 404.html for client-side routing From 94be1954da7159144a30d813626844d40f3db666 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 11:20:05 +0900 Subject: [PATCH 25/49] =?UTF-8?q?chore:=20deploy=20=E5=B0=82=E7=94=A8?= =?UTF-8?q?=E3=81=AE=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=E3=81=97=E3=80=81=E3=81=9D=E3=82=8C?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 12736d4d4..47123e021 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -37,20 +37,19 @@ jobs: - name: Setup Application Runtime uses: ./.github/actions/setup-application-runtime + - name: Create deploy directory + run: mkdir -p ${{ env.PROJECT_DIR }}/deploy + - name: Build web - run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ + run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ --output ${{ env.PROJECT_DIR }}/deploy working-directory: ${{ env.PROJECT_DIR }} - - name: Copy index.html to 404.html for client-side routing - run: cp index.html 404.html - working-directory: ${{ env.PROJECT_DIR }}/build/web - # https://github.com/actions/upload-pages-artifact - name: Upload static files as artifact id: deployment uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: - path: ${{ env.PROJECT_DIR }}/build/web + path: ${{ env.PROJECT_DIR }}/deploy deploy: environment: From e7915d20519e94923c39086f849cd013b311e516 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 11:25:39 +0900 Subject: [PATCH 26/49] =?UTF-8?q?chore:=20deloy=E5=85=88=E3=82=92PR=20Numb?= =?UTF-8?q?er=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 47123e021..a169a1407 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -38,7 +38,7 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: Create deploy directory - run: mkdir -p ${{ env.PROJECT_DIR }}/deploy + run: mkdir -p ${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }} - name: Build web run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ --output ${{ env.PROJECT_DIR }}/deploy @@ -49,7 +49,7 @@ jobs: id: deployment uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: - path: ${{ env.PROJECT_DIR }}/deploy + path: ${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }} deploy: environment: From 2fc10db6922c3671291b493e66e361e4df7e59b4 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 12:32:29 +0900 Subject: [PATCH 27/49] =?UTF-8?q?chore:=20output=E3=83=87=E3=82=A3?= =?UTF-8?q?=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=97=E3=80=81PR=20Number=E3=81=AB=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index a169a1407..6e7c6c46f 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -41,7 +41,7 @@ jobs: run: mkdir -p ${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }} - name: Build web - run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ --output ${{ env.PROJECT_DIR }}/deploy + run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ --output ${{ env.DEPLOY_DIR }} working-directory: ${{ env.PROJECT_DIR }} # https://github.com/actions/upload-pages-artifact From fb201ff2df7128ae6e931274692152d9b1f539f8 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 12:51:06 +0900 Subject: [PATCH 28/49] =?UTF-8?q?chore:=20base-href=20=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 6e7c6c46f..7b385b961 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -41,7 +41,7 @@ jobs: run: mkdir -p ${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }} - name: Build web - run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ --output ${{ env.DEPLOY_DIR }} + run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }}/ --output ${{ env.DEPLOY_DIR }} working-directory: ${{ env.PROJECT_DIR }} # https://github.com/actions/upload-pages-artifact @@ -54,7 +54,7 @@ jobs: deploy: environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }}${{ env.DEPLOY_DIR }} + url: ${{ steps.deployment.outputs.page_url }}${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }} permissions: pages: write id-token: write From 62df05dc09930063fc7aea56bd09ad5458e20969 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 13:08:44 +0900 Subject: [PATCH 29/49] =?UTF-8?q?add=20;=20configure-pages=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 7b385b961..6aa507d78 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -44,6 +44,10 @@ jobs: run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }}/ --output ${{ env.DEPLOY_DIR }} working-directory: ${{ env.PROJECT_DIR }} + # https://github.com/actions/configure-pages + - name: Setup Pages + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b + # https://github.com/actions/upload-pages-artifact - name: Upload static files as artifact id: deployment From 40d871400291a3cf6b0ef3ed0dbc1177da8bf4d9 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 13:25:17 +0900 Subject: [PATCH 30/49] =?UTF-8?q?chore:=20subdirectory=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=81=A7=E3=83=87=E3=83=97=E3=83=AD=E3=82=A4=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E8=A9=A6?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 6aa507d78..43b8fa6c7 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -37,13 +37,35 @@ jobs: - name: Setup Application Runtime uses: ./.github/actions/setup-application-runtime - - name: Create deploy directory - run: mkdir -p ${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }} - - name: Build web - run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }}/ --output ${{ env.DEPLOY_DIR }} + run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ working-directory: ${{ env.PROJECT_DIR }} + + - name: Create combined deployment directory + run: mkdir -p deployment-output/${{ env.DEPLOY_DIR }} + + - name: Copy build to deployment directory + run: cp -R ${{ env.PROJECT_DIR }}/build/web/. deployment-output/${{ env.DEPLOY_DIR }} + + # --- Handle SPA Routing with 404.html (Crucial for direct access to sub-paths) --- + # This creates a 'root' 404.html to catch any direct access that isn't a valid path. + # It should point to a central index.html or a custom 404 page if you have one. + # For multiple apps, you might need a custom 404.html that directs users to your main landing page. + # If 'fuga' and 'saga' are truly independent, you might also need 404.html inside their respective deployment folders + # for internal routing (e.g., deployment-output/hoge/fuga/404.html). + - name: Create a basic root index and 404 for navigation (Optional but recommended) + run: | + echo 'My Apps

Welcome!

Visit Fuga App or Saga App

' > deployment-output/index.html + cp deployment-output/index.html deployment-output/404.html + + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + # This is the directory that will be the root of your GitHub Pages site. + # Its internal structure will define your URL paths. + path: ./deployment-output + # https://github.com/actions/configure-pages - name: Setup Pages uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b From c3dc2ed0fef07eaca6147d05a4a2b2e2a0576de9 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 13:29:07 +0900 Subject: [PATCH 31/49] =?UTF-8?q?fix:=20=E9=87=8D=E8=A4=87=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 43b8fa6c7..30d7da30f 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -59,28 +59,17 @@ jobs: echo 'My Apps

Welcome!

Visit Fuga App or Saga App

' > deployment-output/index.html cp deployment-output/index.html deployment-output/404.html - - name: Upload GitHub Pages artifact - uses: actions/upload-pages-artifact@v3 - with: - # This is the directory that will be the root of your GitHub Pages site. - # Its internal structure will define your URL paths. - path: ./deployment-output - - # https://github.com/actions/configure-pages - - name: Setup Pages - uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b - # https://github.com/actions/upload-pages-artifact - name: Upload static files as artifact id: deployment uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: - path: ${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }} + path: ./deployment-output deploy: environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }}${{ env.PROJECT_DIR }}/${{ env.DEPLOY_DIR }} + url: ${{ steps.deployment.outputs.page_url }} permissions: pages: write id-token: write From 623ed157373f9ad4c6fc16b6a56839e43c9e5713 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 14:34:25 +0900 Subject: [PATCH 32/49] =?UTF-8?q?chore:=20=E3=83=AA=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0=E3=81=97=E3=80=81?= =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AAjob=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 30d7da30f..34c8b5feb 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -21,7 +21,7 @@ concurrency: env: PROJECT_DIR: apps/catalog - DEPLOY_DIR: ${{ github.event.number }} + DEPLOY_DIR: deploy jobs: build: @@ -38,33 +38,21 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: Build web - run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.DEPLOY_DIR }}/ + run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ github.event.number }}/ working-directory: ${{ env.PROJECT_DIR }} - - name: Create combined deployment directory - run: mkdir -p deployment-output/${{ env.DEPLOY_DIR }} - - - name: Copy build to deployment directory - run: cp -R ${{ env.PROJECT_DIR }}/build/web/. deployment-output/${{ env.DEPLOY_DIR }} - - # --- Handle SPA Routing with 404.html (Crucial for direct access to sub-paths) --- - # This creates a 'root' 404.html to catch any direct access that isn't a valid path. - # It should point to a central index.html or a custom 404 page if you have one. - # For multiple apps, you might need a custom 404.html that directs users to your main landing page. - # If 'fuga' and 'saga' are truly independent, you might also need 404.html inside their respective deployment folders - # for internal routing (e.g., deployment-output/hoge/fuga/404.html). - - name: Create a basic root index and 404 for navigation (Optional but recommended) + - name: Create & Copy combined deployment directory run: | - echo 'My Apps

Welcome!

Visit Fuga App or Saga App

' > deployment-output/index.html - cp deployment-output/index.html deployment-output/404.html + mkdir -p ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ + cp -R ${{ env.PROJECT_DIR }}/build/web/. ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ # https://github.com/actions/upload-pages-artifact - name: Upload static files as artifact id: deployment uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: - path: ./deployment-output + path: ./${{ env.DEPLOY_DIR }} deploy: environment: From 16edd2b8b9701abcc79e6b6f828470c97a81e230 Mon Sep 17 00:00:00 2001 From: r0227n Date: Thu, 29 May 2025 14:40:51 +0900 Subject: [PATCH 33/49] =?UTF-8?q?chore:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E6=94=B9=E8=A1=8C=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 34c8b5feb..d300a4e31 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -41,7 +41,6 @@ jobs: run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ github.event.number }}/ working-directory: ${{ env.PROJECT_DIR }} - - name: Create & Copy combined deployment directory run: | mkdir -p ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ @@ -57,7 +56,7 @@ jobs: deploy: environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + url: ${{ steps.deployment.outputs.page_url }}${{ github.event.number }} permissions: pages: write id-token: write From d7a95a75814a93935dd84a819d1a711b160cc172 Mon Sep 17 00:00:00 2001 From: r0227n Date: Fri, 30 May 2025 14:05:59 +0900 Subject: [PATCH 34/49] =?UTF-8?q?chore:=20artifact=E3=81=AE=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E6=9C=9F=E9=96=93=E3=82=923=E6=97=A5=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index d300a4e31..e6cf03f2e 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -52,6 +52,7 @@ jobs: uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ./${{ env.DEPLOY_DIR }} + retention-days: 3 deploy: environment: From 8a18644b5f40abbc0a43a0fb9a79e94b95a4ea0a Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 2 Jun 2025 08:59:56 +0900 Subject: [PATCH 35/49] =?UTF-8?q?chore:=20artifact=E3=82=92=E8=A4=87?= =?UTF-8?q?=E6=95=B0=E4=BB=B6=E5=8F=96=E5=BE=97=E3=81=97=E3=80=81=E3=83=87?= =?UTF-8?q?=E3=83=97=E3=83=AD=E3=82=A4=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cspell/github-action-term.txt | 1 + .../workflows/github-pages-pull-request.yml | 72 ++++++++++++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/.cspell/github-action-term.txt b/.cspell/github-action-term.txt index f526704ed..167e7a774 100644 --- a/.cspell/github-action-term.txt +++ b/.cspell/github-action-term.txt @@ -11,3 +11,4 @@ srvaroa startswith webframeworks elif +tonumber diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index e6cf03f2e..a0ab0aecb 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -45,12 +45,12 @@ jobs: run: | mkdir -p ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ cp -R ${{ env.PROJECT_DIR }}/build/web/. ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ - # https://github.com/actions/upload-pages-artifact - name: Upload static files as artifact id: deployment uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: + name: web-content-${{ github.event.number }} path: ./${{ env.DEPLOY_DIR }} retention-days: 3 @@ -65,6 +65,76 @@ jobs: runs-on: ubuntu-22.04 needs: build steps: + # https://github.com/actions/checkout + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Calculate 3 days ago date (UTC) + id: date_calc + run: echo "start_date=$(date -u -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + + - name: Get run IDs from the last 3 days for the triggering workflow + id: get_run_ids + run: | + START_DATE="${{ steps.date_calc.outputs.start_date }}" + echo "Fetching runs for workflow: '${{ github.workflow }}' created since $START_DATE" + # gh run list で対象ワークフローの過去3日間の成功した実行IDを取得 + # 現在のデプロイワークフロー自身のrun_idは除外 + # jqでdatabaseId(run_id)を抽出し、改行区切りで出力 + RUN_IDS=$(gh run list \ + --workflow "${{ github.workflow }}" \ + --status success \ + --created ">=$START_DATE" \ + --json databaseId,headBranch,createdAt \ + | jq -r --arg current_run_id "1" ' + group_by(.headBranch) | + map(max_by(.createdAt)) | + map(select(.databaseId != ($current_run_id | tonumber))) | + map({branch: .headBranch, run_id: .databaseId}) + ') + if [ -z "$RUN_IDS" ]; then + echo "No successful runs found in the last 3 days for workflow: '${{ github.workflow }}'." + exit 0 # 実行IDが見つからなければ、ジョブを成功として終了 + fi + echo "Found run IDs and their branches:" + echo "$RUN_IDS" + { + echo "run_data<> "$GITHUB_OUTPUT" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # gh CLI認証用 + + - name: Download artifacts for each run ID + run: | + mkdir -p _site # GitHub Pagesのルートディレクトリ + # 出力された各行 (run_id branch_name) をループ処理 + echo '${{ steps.get_run_ids.outputs.run_data }}' | jq -r '.[] | "\(.run_id) \(.branch)"' | while read -r run_id branch; do + if [ -n "$run_id" ] && [ -n "$branch" ]; then + echo "Downloading artifact for run ID: $run_id from branch: $branch" + # ダウンロード先のパスは "_site/branch/" とする + DOWNLOAD_PATH="_site/$branch" + mkdir -p "$DOWNLOAD_PATH" + # gh run download でartifactをダウンロード + gh run download "$run_id" \ + --dir "$DOWNLOAD_PATH" \ + --name "web-content-*" \ + --repo "$GITHUB_REPOSITORY" \ + || { echo "Warning: Could not download artifact for run $run_id. Skipping."; continue; } + echo "Downloaded artifact to $DOWNLOAD_PATH" + fi + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # gh CLI認証用 + + # https://github.com/actions/upload-pages-artifact + - name: Upload GitHub Pages artifact + id: upload_pages_artifact + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + with: + path: ./_site + # https://github.com/actions/deploy-pages - name: Deploy to GitHub Pages id: deployment From f95d7ee0d2d6bd94a44ec20bb16385dd734a49cc Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 2 Jun 2025 11:19:40 +0900 Subject: [PATCH 36/49] =?UTF-8?q?chore:=20artifact=20upload=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E4=B8=80=E7=AE=87=E6=89=80=E3=81=AB=E9=9B=86?= =?UTF-8?q?=E7=B4=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 52 ++++++++----------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index a0ab0aecb..002bfb70d 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -38,6 +38,7 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: Build web + # run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ github.event.pull_request.head.ref }}/ run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ github.event.number }}/ working-directory: ${{ env.PROJECT_DIR }} @@ -45,29 +46,6 @@ jobs: run: | mkdir -p ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ cp -R ${{ env.PROJECT_DIR }}/build/web/. ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ - # https://github.com/actions/upload-pages-artifact - - name: Upload static files as artifact - id: deployment - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 - with: - name: web-content-${{ github.event.number }} - path: ./${{ env.DEPLOY_DIR }} - retention-days: 3 - - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }}${{ github.event.number }} - permissions: - pages: write - id-token: write - timeout-minutes: 5 - runs-on: ubuntu-22.04 - needs: build - steps: - # https://github.com/actions/checkout - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Calculate 3 days ago date (UTC) id: date_calc @@ -78,6 +56,7 @@ jobs: run: | START_DATE="${{ steps.date_calc.outputs.start_date }}" echo "Fetching runs for workflow: '${{ github.workflow }}' created since $START_DATE" + # gh run list で対象ワークフローの過去3日間の成功した実行IDを取得 # 現在のデプロイワークフロー自身のrun_idは除外 # jqでdatabaseId(run_id)を抽出し、改行区切りで出力 @@ -92,6 +71,7 @@ jobs: map(select(.databaseId != ($current_run_id | tonumber))) | map({branch: .headBranch, run_id: .databaseId}) ') + if [ -z "$RUN_IDS" ]; then echo "No successful runs found in the last 3 days for workflow: '${{ github.workflow }}'." exit 0 # 実行IDが見つからなければ、ジョブを成功として終了 @@ -103,25 +83,26 @@ jobs: echo "$RUN_IDS" echo "EOF" } >> "$GITHUB_OUTPUT" + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # gh CLI認証用 - name: Download artifacts for each run ID run: | mkdir -p _site # GitHub Pagesのルートディレクトリ + # 出力された各行 (run_id branch_name) をループ処理 echo '${{ steps.get_run_ids.outputs.run_data }}' | jq -r '.[] | "\(.run_id) \(.branch)"' | while read -r run_id branch; do if [ -n "$run_id" ] && [ -n "$branch" ]; then echo "Downloading artifact for run ID: $run_id from branch: $branch" # ダウンロード先のパスは "_site/branch/" とする - DOWNLOAD_PATH="_site/$branch" + DOWNLOAD_PATH="${{ env.DEPLOY_DIR }}/$branch" mkdir -p "$DOWNLOAD_PATH" + # gh run download でartifactをダウンロード gh run download "$run_id" \ --dir "$DOWNLOAD_PATH" \ - --name "web-content-*" \ - --repo "$GITHUB_REPOSITORY" \ - || { echo "Warning: Could not download artifact for run $run_id. Skipping."; continue; } + --repo "$GITHUB_REPOSITORY" echo "Downloaded artifact to $DOWNLOAD_PATH" fi done @@ -129,12 +110,23 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # gh CLI認証用 # https://github.com/actions/upload-pages-artifact - - name: Upload GitHub Pages artifact - id: upload_pages_artifact + - name: Upload static files as artifact + id: deployment uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: - path: ./_site + path: ./${{ env.DEPLOY_DIR }} + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }}${{ github.event.number }} + permissions: + pages: write + id-token: write + timeout-minutes: 5 + runs-on: ubuntu-22.04 + needs: build + steps: # https://github.com/actions/deploy-pages - name: Deploy to GitHub Pages id: deployment From e6421fb27e7c9a90c540faeb0ca321c02ebde585 Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 2 Jun 2025 12:02:31 +0900 Subject: [PATCH 37/49] =?UTF-8?q?chore:=20branch=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=81=A7=E3=83=93=E3=83=AB=E3=83=89=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 002bfb70d..9c6ac5c69 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -38,14 +38,13 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: Build web - # run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ github.event.pull_request.head.ref }}/ - run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ github.event.number }}/ + run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ github.event.pull_request.head.ref }}/ working-directory: ${{ env.PROJECT_DIR }} - name: Create & Copy combined deployment directory run: | - mkdir -p ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ - cp -R ${{ env.PROJECT_DIR }}/build/web/. ${{ env.DEPLOY_DIR }}/${{ github.event.number }}/ + mkdir -p ${{ env.DEPLOY_DIR }}/${{ github.event.pull_request.head.ref }}/ + cp -R ${{ env.PROJECT_DIR }}/build/web/. ${{ env.DEPLOY_DIR }}/${{ github.event.pull_request.head.ref }}/ - name: Calculate 3 days ago date (UTC) id: date_calc @@ -104,6 +103,17 @@ jobs: --dir "$DOWNLOAD_PATH" \ --repo "$GITHUB_REPOSITORY" echo "Downloaded artifact to $DOWNLOAD_PATH" + + # アーティファクトを解凍して展開 + if [ -f "$DOWNLOAD_PATH/github-pages/artifact.tar" ]; then + echo "Extracting artifact.tar to $DOWNLOAD_PATH" + tar -xf "$DOWNLOAD_PATH/github-pages/artifact.tar" -C "$DOWNLOAD_PATH" + rm -rf "$DOWNLOAD_PATH/github-pages" # 解凍後のtarファイルとディレクトリを削除 + else + echo "Warning: artifact.tar not found in $DOWNLOAD_PATH/github-pages/" + fi + else + echo "Warning: run_id or branch is empty" fi done env: From 963c5f5d8cbae705eb33532e8f658a87f5c5d117 Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 2 Jun 2025 12:58:59 +0900 Subject: [PATCH 38/49] =?UTF-8?q?chore:=20=E8=A7=A3=E5=87=8D=E5=85=88?= =?UTF-8?q?=E3=82=92=E7=B5=82=E5=A7=8B=E7=B5=B5=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 9c6ac5c69..8b0576c1c 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -95,7 +95,7 @@ jobs: if [ -n "$run_id" ] && [ -n "$branch" ]; then echo "Downloading artifact for run ID: $run_id from branch: $branch" # ダウンロード先のパスは "_site/branch/" とする - DOWNLOAD_PATH="${{ env.DEPLOY_DIR }}/$branch" + DOWNLOAD_PATH="dl_artifact/$branch" mkdir -p "$DOWNLOAD_PATH" # gh run download でartifactをダウンロード @@ -107,7 +107,8 @@ jobs: # アーティファクトを解凍して展開 if [ -f "$DOWNLOAD_PATH/github-pages/artifact.tar" ]; then echo "Extracting artifact.tar to $DOWNLOAD_PATH" - tar -xf "$DOWNLOAD_PATH/github-pages/artifact.tar" -C "$DOWNLOAD_PATH" + mkdir -p "${{ env.DEPLOY_DIR }}/$branch" + tar -xf "$DOWNLOAD_PATH/github-pages/artifact.tar" -C "${{ env.DEPLOY_DIR }}/$branch" rm -rf "$DOWNLOAD_PATH/github-pages" # 解凍後のtarファイルとディレクトリを削除 else echo "Warning: artifact.tar not found in $DOWNLOAD_PATH/github-pages/" From 4a019c7a1b239985c6694b807f2837603c1540c6 Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 2 Jun 2025 13:28:31 +0900 Subject: [PATCH 39/49] =?UTF-8?q?chore:=20=E6=A4=9C=E8=A8=BC=E7=94=A8?= =?UTF-8?q?=E3=81=AB=E6=9C=9F=E9=96=93=E3=82=921=E6=97=A5=E3=81=BE?= =?UTF-8?q?=E3=81=A7=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 8b0576c1c..ad2853f55 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -48,7 +48,8 @@ jobs: - name: Calculate 3 days ago date (UTC) id: date_calc - run: echo "start_date=$(date -u -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + # run: echo "start_date=$(date -u -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + run: echo "start_date=$(date -u -d '1 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" - name: Get run IDs from the last 3 days for the triggering workflow id: get_run_ids From 4d4276d844e133b8bf64fae763263b759326cad3 Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 2 Jun 2025 15:12:24 +0900 Subject: [PATCH 40/49] =?UTF-8?q?refactor:=20=E5=87=BA=E5=8A=9B=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8BURL=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/github-pages-pull-request.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index ad2853f55..cbd1a123f 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -22,6 +22,7 @@ concurrency: env: PROJECT_DIR: apps/catalog DEPLOY_DIR: deploy + CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} jobs: build: @@ -38,18 +39,17 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: Build web - run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ github.event.pull_request.head.ref }}/ + run: flutter build web --release --base-href /${{ github.event.repository.name }}/${{ env.CURRENT_BRANCH }}/ working-directory: ${{ env.PROJECT_DIR }} - name: Create & Copy combined deployment directory run: | - mkdir -p ${{ env.DEPLOY_DIR }}/${{ github.event.pull_request.head.ref }}/ - cp -R ${{ env.PROJECT_DIR }}/build/web/. ${{ env.DEPLOY_DIR }}/${{ github.event.pull_request.head.ref }}/ + mkdir -p ${{ env.DEPLOY_DIR }}/${{ env.CURRENT_BRANCH }}/ + cp -R ${{ env.PROJECT_DIR }}/build/web/. ${{ env.DEPLOY_DIR }}/${{ env.CURRENT_BRANCH }}/ - name: Calculate 3 days ago date (UTC) id: date_calc - # run: echo "start_date=$(date -u -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" - run: echo "start_date=$(date -u -d '1 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + run: echo "start_date=$(date -u -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" - name: Get run IDs from the last 3 days for the triggering workflow id: get_run_ids @@ -65,10 +65,11 @@ jobs: --status success \ --created ">=$START_DATE" \ --json databaseId,headBranch,createdAt \ - | jq -r --arg current_run_id "1" ' + | jq -r --arg current_run_id "1" --arg current_branch "${{ env.CURRENT_BRANCH }}" ' group_by(.headBranch) | map(max_by(.createdAt)) | map(select(.databaseId != ($current_run_id | tonumber))) | + map(select(.headBranch != $current_branch)) | map({branch: .headBranch, run_id: .databaseId}) ') @@ -108,8 +109,7 @@ jobs: # アーティファクトを解凍して展開 if [ -f "$DOWNLOAD_PATH/github-pages/artifact.tar" ]; then echo "Extracting artifact.tar to $DOWNLOAD_PATH" - mkdir -p "${{ env.DEPLOY_DIR }}/$branch" - tar -xf "$DOWNLOAD_PATH/github-pages/artifact.tar" -C "${{ env.DEPLOY_DIR }}/$branch" + tar -xf "$DOWNLOAD_PATH/github-pages/artifact.tar" -C "${{ env.DEPLOY_DIR }}" rm -rf "$DOWNLOAD_PATH/github-pages" # 解凍後のtarファイルとディレクトリを削除 else echo "Warning: artifact.tar not found in $DOWNLOAD_PATH/github-pages/" @@ -131,7 +131,7 @@ jobs: deploy: environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }}${{ github.event.number }} + url: ${{ steps.deployment.outputs.page_url }}${{ env.CURRENT_BRANCH }} permissions: pages: write id-token: write From f3c932d2501fdeadbeede7136e56db80f3f8b730 Mon Sep 17 00:00:00 2001 From: r0227n Date: Mon, 2 Jun 2025 15:43:44 +0900 Subject: [PATCH 41/49] =?UTF-8?q?chore:=20=E4=B8=8D=E9=81=A9=E5=88=87?= =?UTF-8?q?=E3=81=AA=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index cbd1a123f..64ff2b950 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -59,7 +59,6 @@ jobs: # gh run list で対象ワークフローの過去3日間の成功した実行IDを取得 # 現在のデプロイワークフロー自身のrun_idは除外 - # jqでdatabaseId(run_id)を抽出し、改行区切りで出力 RUN_IDS=$(gh run list \ --workflow "${{ github.workflow }}" \ --status success \ @@ -96,7 +95,6 @@ jobs: echo '${{ steps.get_run_ids.outputs.run_data }}' | jq -r '.[] | "\(.run_id) \(.branch)"' | while read -r run_id branch; do if [ -n "$run_id" ] && [ -n "$branch" ]; then echo "Downloading artifact for run ID: $run_id from branch: $branch" - # ダウンロード先のパスは "_site/branch/" とする DOWNLOAD_PATH="dl_artifact/$branch" mkdir -p "$DOWNLOAD_PATH" From 52a02326b442f5905b65d2ebd3d454c6792aa453 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 3 Jun 2025 08:20:26 +0900 Subject: [PATCH 42/49] =?UTF-8?q?refactor:=20current=5Frun=5Fid=E3=82=92?= =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=E3=81=AE=E3=81=9F=E3=82=81=E3=80=81?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 64ff2b950..cf9b6585d 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -64,10 +64,9 @@ jobs: --status success \ --created ">=$START_DATE" \ --json databaseId,headBranch,createdAt \ - | jq -r --arg current_run_id "1" --arg current_branch "${{ env.CURRENT_BRANCH }}" ' + | jq -r --arg current_branch "${{ env.CURRENT_BRANCH }}" ' group_by(.headBranch) | map(max_by(.createdAt)) | - map(select(.databaseId != ($current_run_id | tonumber))) | map(select(.headBranch != $current_branch)) | map({branch: .headBranch, run_id: .databaseId}) ') From 07bdcbb0821642a7b016c94e0d73e017a7325060 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 3 Jun 2025 10:30:45 +0900 Subject: [PATCH 43/49] =?UTF-8?q?chore:=20=E5=87=BA=E5=8A=9B=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8Burl=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC?= =?UTF-8?q?=E3=83=9E=E3=83=83=E3=83=88=E3=82=92=E3=82=B3=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=AB=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index cf9b6585d..a24da2180 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -128,6 +128,7 @@ jobs: deploy: environment: name: github-pages + # // のフォーマットでURLを生成 url: ${{ steps.deployment.outputs.page_url }}${{ env.CURRENT_BRANCH }} permissions: pages: write From 58578cf9b070831c89c7c6a392adcf0f89433b6e Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 3 Jun 2025 14:33:32 +0900 Subject: [PATCH 44/49] =?UTF-8?q?chore:=20mason=E3=81=AF=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=9F?= =?UTF-8?q?=E3=82=81=E3=80=81=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index a24da2180..8f6f9ec19 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -10,7 +10,6 @@ on: - "docs/**" - "scripts/**" - "tools/**" - - "mason.yaml" - "**/docs/**" - "**/test/**" - "**.md" From 93db198871dc69d6fdf3f2246839992cc1e26ec7 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 3 Jun 2025 14:42:07 +0900 Subject: [PATCH 45/49] =?UTF-8?q?chore:=20permissions:=20actions:=20read?= =?UTF-8?q?=E3=82=92=E6=98=8E=E7=A4=BA=E7=9A=84=E3=81=AB=E5=AE=A3=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 8f6f9ec19..5eec4a0bb 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -25,6 +25,8 @@ env: jobs: build: + permissions: + actions: read timeout-minutes: 5 runs-on: ubuntu-22.04 # NOTE: See https://github.com/yumemi-inc/flutter-mobile-project-template/blob/main/docs/GITHUB_PAGES_PREVIEW.md From bbeb9bcfbe769f8bed2d80a881787fae45d65239 Mon Sep 17 00:00:00 2001 From: r0227n Date: Tue, 3 Jun 2025 14:44:40 +0900 Subject: [PATCH 46/49] =?UTF-8?q?chore:=20checkout=20actions=20=E3=82=92v4?= =?UTF-8?q?.1.7=E3=81=AB=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 5eec4a0bb..3e233e7da 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -34,7 +34,7 @@ jobs: steps: # https://github.com/actions/checkout - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Setup Application Runtime uses: ./.github/actions/setup-application-runtime From 26acab64648df2f1287b0a78dd31aee594b7a618 Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 4 Jun 2025 10:19:04 +0900 Subject: [PATCH 47/49] =?UTF-8?q?chore:=20file=E3=81=AE=E5=85=88=E9=A0=AD?= =?UTF-8?q?=E3=81=AB=E3=83=A1=E3=82=BF=E6=83=85=E5=A0=B1=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/initialization/GITHUB_PAGES_PREVIEW.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/initialization/GITHUB_PAGES_PREVIEW.md b/.github/initialization/GITHUB_PAGES_PREVIEW.md index 787639b3e..8538c1a8b 100644 --- a/.github/initialization/GITHUB_PAGES_PREVIEW.md +++ b/.github/initialization/GITHUB_PAGES_PREVIEW.md @@ -1,3 +1,10 @@ +--- +title: "[初期セットアップ(任意)] Pull Request内でデプロイのワークフローを設定する" +labels: + - initialization + - optional +--- + # GitHub Pages プレビュー この Issue の対応は任意です。 From 8b647b44995b8af4e178f1c07bf0ec51c4a27d1b Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 4 Jun 2025 10:21:55 +0900 Subject: [PATCH 48/49] =?UTF-8?q?fix:=20=E3=83=AA=E3=82=B9=E3=83=88?= =?UTF-8?q?=E8=A1=A8=E8=A8=98=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=83=83=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/initialization/GITHUB_PAGES_PREVIEW.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/initialization/GITHUB_PAGES_PREVIEW.md b/.github/initialization/GITHUB_PAGES_PREVIEW.md index 8538c1a8b..f873d6ec8 100644 --- a/.github/initialization/GITHUB_PAGES_PREVIEW.md +++ b/.github/initialization/GITHUB_PAGES_PREVIEW.md @@ -1,8 +1,8 @@ --- title: "[初期セットアップ(任意)] Pull Request内でデプロイのワークフローを設定する" labels: - - initialization - - optional + - initialization + - optional --- # GitHub Pages プレビュー From bee9da9f14d70e35b99fbef2d7e9ea61871b67e6 Mon Sep 17 00:00:00 2001 From: r0227n Date: Wed, 4 Jun 2025 10:48:06 +0900 Subject: [PATCH 49/49] =?UTF-8?q?chore:=20artifact=E3=81=AE=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E6=9C=9F=E9=96=93=E3=82=923=E6=97=A5=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-pages-pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-pages-pull-request.yml b/.github/workflows/github-pages-pull-request.yml index 3e233e7da..40ba78d3c 100644 --- a/.github/workflows/github-pages-pull-request.yml +++ b/.github/workflows/github-pages-pull-request.yml @@ -125,6 +125,7 @@ jobs: uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ./${{ env.DEPLOY_DIR }} + retention-days: 3 deploy: environment: