Skip to content

CI: Cloud Run への自動デプロイ (GitHub Actions) - #2

Open
abe-tetsu wants to merge 1 commit into
refactor/cleanupfrom
ci/deploy
Open

CI: Cloud Run への自動デプロイ (GitHub Actions)#2
abe-tetsu wants to merge 1 commit into
refactor/cleanupfrom
ci/deploy

Conversation

@abe-tetsu

Copy link
Copy Markdown
Owner

概要

main への push で Cloud Run へ自動デプロイする GitHub Actions を追加する。#1(リファクタ)に積み上げた PR で、base は refactor/cleanup#1 マージ後に main へ向き直る。

内容

  • .github/workflows/deploy.yml を追加
    • main への push で、変更のあったサービス(api / overlay / console)だけをデプロイ(dorny/paths-filter で判定)
    • workflow_dispatch による手動実行も可(全サービス対象)
    • GCP 認証は Workload Identity 連携(キーレス)
    • API はデプロイ前に go test ./... を実行
    • デプロイ flag は既存 Makefile の make deploy-* と同一
  • README にデプロイ節と必要な GitHub Secrets を追記

有効化に必要な事前設定(リポジトリ外)

GCP 側(Workload Identity プール/プロバイダ + デプロイ用 SA + IAM)と、以下の GitHub Secrets が必要:

  • GCP_WIF_PROVIDER
  • GCP_SERVICE_ACCOUNT
  • SUBNOTIFY_YOUTUBE_CLIENT_ID
  • SUBNOTIFY_YOUTUBE_CLIENT_SECRET

設定手順はチャットで共有済み。

レビュー時の補足

  • ワークフローは main への push で発火するため、main にマージされて初めて有効になる
  • デプロイ構成(min-instances=0 等)は現状の Makefile に合わせており、挙動は変えていない

🤖 Generated with Claude Code

- Auto-deploy changed services (api/overlay/console) on push to main,
  plus manual workflow_dispatch
- Authenticate to GCP via Workload Identity Federation (keyless)
- Run go test before deploying the API
- Document required GitHub Secrets in README

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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 this pull request may close these issues.

1 participant