Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staging deploy が欲しい #325

Closed
kachick opened this issue Nov 10, 2024 · 5 comments · Fixed by #342
Closed

staging deploy が欲しい #325

kachick opened this issue Nov 10, 2024 · 5 comments · Fixed by #342
Assignees

Comments

@kachick
Copy link
Collaborator

kachick commented Nov 10, 2024

PRベースにせっかくなっているのだから、レビュー時にサクッとビルドされた結果を眺められるのが欲しい

ただ github pages はこれをきれいに実現出来ない認識なので、やるなら firebase とか cloudflare とか netlify、Vercel になってしまうんやろうなぁ・・・(自分も firebase で hugo ステージング使ってるのはあるけれど、cloudflare 経由ではまだやってない)

@kachick
Copy link
Collaborator Author

kachick commented Jan 8, 2025

cloudflare

Cloudflare Pagesでの staging 作成、向こうが用意してないツールセットでビルドする必要あったりすると kachick/kachick.github.io#252 みたいに諸々手書きにする必要があった。

このサイトはCloudflare Pages対応済みな hugoを使っているので、hugo のバージョンを厳密には気にせずブランチ単位の管理で向こうに全部お任せな方法を使うと楽に済みそうな気がする。

(それはそれとして作られたstagingの寿命管理方法がよくわかってないけど)

firebase

mobu-of-the-world/mobu#727
kachick/emobu#4

@pankona
Copy link
Owner

pankona commented Jan 8, 2025

原理上は fitebase のデプロイまわりを一部パチっていくことでステージングデプロイが実現できそうな気はしているけれども、まっとうなやり方かと言われるとやや自信ない

@kachick
Copy link
Collaborator Author

kachick commented Jan 9, 2025

#325 (comment)

の firebase コードはそのまま ステージングやってるで。
firebase 側が普通に提供している機能だったと思う。

https://github.com/mobu-of-the-world/mobu/blob/83e0f0ae25feb54294ca1642f5a021d9381bab21/.github/workflows/firebase-hosting-merge.yml#L33-L38
https://github.com/mobu-of-the-world/mobu/blob/83e0f0ae25feb54294ca1642f5a021d9381bab21/.github/workflows/firebase-hosting-pull-request.yml#L32-L36

channelId: live が付けば production、つかなければ staging。 staging には expiration が設定されててしばらくすると消えるみたいな

@kachick
Copy link
Collaborator Author

kachick commented Jan 9, 2025

人間がPRを送ると mobu-of-the-world/mobu#1619 (comment) こんな感じにステージング用意したコメントがついてるでしょ

bot からのは止めてある https://github.com/mobu-of-the-world/mobu/blob/83e0f0ae25feb54294ca1642f5a021d9381bab21/.github/workflows/firebase-hosting-pull-request.yml#L18

ということで、firebase で project 作って secrets にこれらを登録してくれれば github actions ベースで管理ができる。

@kachick
Copy link
Collaborator Author

kachick commented Jan 9, 2025

Web UIから管理画面へのアクセス出来ないのでどうかと思ったが、collaborator でも API 経由でsecretsに登録できるっぽい。便利

> gh secret set SECRET_TEST_BY_KACHICK --body ':)'
✓ Set Actions secret SECRET_TEST_BY_KACHICK for pankona/pankona.github.com

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 a pull request may close this issue.

2 participants