Skip to content

[397] GitHub Pagesへのdeploy pipeline 作成#412

Merged
den0206 merged 62 commits into
mainfrom
feature/GH-397
Jun 4, 2025
Merged

[397] GitHub Pagesへのdeploy pipeline 作成#412
den0206 merged 62 commits into
mainfrom
feature/GH-397

Conversation

@r0227n
Copy link
Copy Markdown
Contributor

@r0227n r0227n commented May 13, 2025

概要

セキュリティの観念から、apps/catalogのデプロイをFirebase HostingからGitHub Pagesへ移行しました。

GitHub Pageへのデプロイ内容

  • DEPLOY_DIRに作業ブランチのapps/catalogのビルドした内容を保存
  • 3日前までの実行履歴を確認し、branchごとに最新のAction実行履歴からartifactをダウンロードし、DEPLOY_DIRに保存
  • DEPLOY_DIRの内容を全てGitHub Pagesにデプロイ

※ artifactの有効期限は3日に設定しているため、Action実行から3日経過したURLは閲覧不可能

レビュー観点

  • github-pages-pull-request.yml の内容を確認し、Pagesへのデプロイ処理に問題がないか確認していただきたいです

レビューレベル

  • Lv1: ぱっとみて違和感がないかチェックして Approve する
  • Lv2: 仕様レベルまで理解して、仕様通りに動くかある程度検証して Approve する
  • Lv3: 実際に環境で動作確認したうえで Approve する

レビュー優先度

  • すぐに見てもらいたい ( hotfix など ) 🚀
  • 今日中に見てもらいたい 🚗
  • 今日〜明日中で見てもらいたい 🚶
  • 数日以内で見てもらいたい 🐢

画像 / 動画

N/A

確認したこと

を並列にデプロイし、動作確認ができることを確認した

動作確認手順

https://github.com/yumemi-inc/flutter-mobile-project-template/actions/runs/15385643771/job/43283643045

↑上記のURL(f3c932d)のActionの履歴)にアクセスし、Re-run all jobsを実行する。

image

その後、PRの末尾に投稿されるView deploymentをクリックしデプロイされた内容を確認する。

備考

同時にビルドされても問題ないか確認する用のPR: #520

https://docs.github.com/ja/rest/pages/pages?apiVersion=2022-11-28

上記のドキュメントを確認したが、Visibilityの変更を実施するAPIは未提供だと思う為、パイプライン無いでVisibilityを有効化するjobは実装できていません。そのため、ドキュメントを用意しました。



upload-pages-artifactの仕様

  • 推奨: 1GBのファイル
  • データの保持期間
    • パブリックリポジトリ: 1 ~ 90 日間
    • プライベートリポジトリ: 1 ~ 400 日間

gh run listを実行しActionの実行履歴を取得しているが、

  • PRの番号は取得できない
  • 実行ブランチは取得可能

のため、<domain>/<repository>/<branch名>という形で動作確認できるようになっている。

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2025

Visit the preview URL for this PR (updated for commit db26909):

https://flutter-mobile-project-template-catalog--pr412-feature-8f9kbf1y.web.app

(expires Tue, 20 May 2025 05:45:38 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9ea56735a63d07a7cfe62eb204b0528284c37c23

@r0227n r0227n marked this pull request as ready for review May 13, 2025 06:51
@yumemi-team-review-requester yumemi-team-review-requester Bot requested review from a team, blendthink and den0206 and removed request for a team May 13, 2025 06:52
@github-actions
Copy link
Copy Markdown

Ready for review 🚀

Copy link
Copy Markdown
Contributor Author

@r0227n r0227n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントアウトは事故防止のため、意図的にしています。

Comment thread .github/workflows/github-pages-pull-request.yml Outdated
Comment thread .github/workflows/github-pages-pull-request.yml Outdated
@r0227n r0227n marked this pull request as draft May 13, 2025 06:58
@r0227n
Copy link
Copy Markdown
Contributor Author

r0227n commented May 13, 2025

@YumNumm
お疲れ様です。

現在テンプレートプロジェクト内でFirebaseHostingからGitHub Pagesへホスト先を変更しています。
(Issue: #397 )

GitHub Pagesへのデプロイパイプライン(.github/workflows/github-pages-pull-request.yml)を作成したのですが、実装内容や方針が合っているか不安のため、レビューしていただけないでしょうか?
急ぎの案件ではないため、お手隙のタイミングで確認していただけますと幸いです。


  • 現状: yamlを作成したが、デプロイが問題なく実施できているか動作確認ができていない状態
  • 動作確認できていない理由: パブリックな状態でデプロイしていいか判断がつかないため、一旦デプロイの動作確認は保留中

@YumNumm
Copy link
Copy Markdown
Contributor

YumNumm commented May 13, 2025

@r0227n お疲れ様です!
承知しました👍
本日〜明日目処で確認します!

Copy link
Copy Markdown
Contributor

@YumNumm YumNumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

基本的に問題なさそうです!!

(publicな状態で)GitHub Pagesにデプロイしていいか判断がつかないため、コメントアウトしています。
yumemi-inc/flutter-mobile-project-templateにおいて、GitHub Pagesをデプロイしても問題ないか? という意図で合っていますでしょうか?
もし、そうであれば デプロイしてしまって問題ないと思います👍️
(自分は権限がなくて見れないですが、Repository側のPages設定が出来ていることを確認お願いします!)
こんな感じのやつです!

image

Comment on lines +12 to +16
[ドキュメント][1] に従ってGitHub Actions ワークフローでGitHub Pageにデプロイ可能にする。

## 2. Visibilityの有効化

[ドキュメント][2] に従って`Visibility`を有効化することにより、アクセス制限を設定する。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo

  • ドキュメントと書いてあるだけだと どのドキュメントを指しているのか分かりにくいので タイトルないしは概要を書いてあげると親切かな〜と思いました
    • 特に、ドキュメントのリンクが2回続いていると同じURLを指していると誤認する可能性があると思いました
  • imo かつ nitなので、対応はおまかせします!
    • ついでに、GitHub PagesにおいてVisibilityの設定はGitHub Enterprise Cloudでしか設定できないので追加しちゃいました
Suggested change
[ドキュメント][1] に従ってGitHub Actions ワークフローでGitHub Pageにデプロイ可能にする。
## 2. Visibilityの有効化
[ドキュメント][2] に従って`Visibility`を有効化することにより、アクセス制限を設定する。
[GitHub Pages サイトの公開元を設定する][1] に従ってGitHub Actions ワークフローでGitHub Pageにデプロイ可能にする。
## 2. Visibilityの有効化
[GitHub Pages サイトの可視性を変更する][2] に従って`Visibility`を有効化することにより、アクセス制限を設定する。
- ただし、この機能はGitHub Enterprise Cloudを契約しているOrganizationでしか利用できません
- GitHub Enterprise Cloud外で非公開のデプロイを行いたい場合、AWS CloudFront, Cloudflare Pages+Zero Trust等を検討してください。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0e49b15 でレビューいただいたドキュメントの内容を更新しました。

Comment thread .github/workflows/github-pages-pull-request.yml
Comment on lines +25 to +26
# 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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo
コメントアウトされている状態だと、yumemi-inc/flutter-mobile-project-templateリポジトリにおいて正常動作するものなのかわからなくなりそう かつ 正常動作しなくなったことに気づけなくなってしまうので、if式で orgがyumemi-incかどうかをチェックするようにして、コメントアウトを外すのはいかがでしょうか?

Suggested change
# 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'
# NOTE: See https://github.com/yumemi-inc/flutter-mobile-project-template/blob/main/docs/GITHUB_PAGES_PREVIEW.md
if: ${{ github.repository_owner == 'yumemi-inc' && github.event.repository.name == 'flutter-mobile-project-template' }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11b6654 で対応しました。

Comment on lines +37 to +40
# https://github.com/marketplace/actions/create-issue-from-file
- uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # v5.0.0
with:
title: "[初期セットアップ(任意)] Pull Request内でデプロイのワークフローを設定する"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good-badge

Comment on lines +11 to +13

[ドキュメント][1] に従ってGitHub Actions ワークフローでGitHub Pageにデプロイ可能にする。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo-badge
こんな書き方できること知りませんでした!

@r0227n
Copy link
Copy Markdown
Contributor Author

r0227n commented May 20, 2025

会話メモ

  • Pagesへのデプロイ自体は問題ない
  • ワークフローのデプロイ方式について、現状だと上書きのため複数件レビューが渋滞すると不便
    • PRが複数件立て込んだ場合、一つのデプロイ先で参照先を分ける方法について、もぐもぐ先生に相談する
    • 勝手なイメージ: <domain>/#<PR_NUMBER> のような形でPR単位でパス分岐できるといいのかな?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2025

⚠️ Rebase or force-push detected in this push
以下のコミットが非線形な履歴となっており、rebase または強制 push の可能性があります:

  • d7b28b3 (docs: TARGET_SDK.mdの情報を更新し、Gradleファイルの記述を修正)

@r0227n r0227n temporarily deployed to github-pages June 3, 2025 05:48 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2025

Compare pubspec.yaml and pubspec.lock. Packages with different version notations

package pubspec.yaml pubspec.lock
test ^1.25.8 1.25.15

@r0227n
Copy link
Copy Markdown
Contributor Author

r0227n commented Jun 3, 2025

@blendthink
レビューありがとうございます。
指摘いただいた部分を修正しましたので、ご確認いただけますと幸いです。

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2025

⚠️ Rebase or force-push detected in this push
以下のコミットが非線形な履歴となっており、rebase または強制 push の可能性があります:

  • 45705ff (chore: build.yamlにflutter_genの設定を追加し、melos run gen時のエラー解決)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2025

Compare pubspec.yaml and pubspec.lock. Packages with different version notations

package pubspec.yaml pubspec.lock
test ^1.25.8 1.25.15

Copy link
Copy Markdown
Contributor

@blendthink blendthink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM です!
ご対応ありがとうございます!

@blendthink blendthink added this pull request to the merge queue Jun 3, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jun 3, 2025
Copy link
Copy Markdown
Contributor

@den0206 den0206 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r0227n

#532 にて変更している点を修正お願いいたします!
コンフリクトも同時に修正されると思います

Comment thread .github/actions/create-issue-at-initialization/action.yaml Outdated
Comment thread .github/initialization/GITHUB_PAGES_PREVIEW.md
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2025

⚠️ Rebase or force-push detected in this push
以下のコミットが非線形な履歴となっており、rebase または強制 push の可能性があります:

  • d0fbcba (docs: typo修正 'frontmatter' の表記を小文字に統一)
  • 7c25082 (docs: 'frontmatter' を辞書に追加)
  • cc40c5b (ci: generate-issue-matrix-at-initialization へリネーム)
  • 5218885 (docs: 修正 YAML Front Matter の表記を小文字に統一)
  • fd5dbf2 (ci: create-issue-from-file の version 5.0.0 に定義)
  • 19e9d85 (refactor: 出力方法をprintからstdout.writeに変更)
  • a3f9efd (ci: 自動Issue生成アクションのワークフローを追加)
  • e1fdae2 (docs: 自動生成Issue のドキュメントを更新)
  • 5b8456b (docs: 自動生成Issue 内にメタデータの付与)

@r0227n
Copy link
Copy Markdown
Contributor Author

r0227n commented Jun 4, 2025

@den0206
レビューありがとうございます。
指摘いただいた部分を修正しましたので、再レビューお願いします。

Copy link
Copy Markdown
Contributor

@den0206 den0206 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r0227n

LGTMです!
ご対応ありがとうございます!

マージします!

@den0206 den0206 added this pull request to the merge queue Jun 4, 2025
Merged via the queue into main with commit 633f31e Jun 4, 2025
15 checks passed
@den0206 den0206 deleted the feature/GH-397 branch June 4, 2025 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improve]: カタログ環境の GitHub Pages 移行

5 participants