ステージング環境へのデプロイワークフローを追加#1497
Conversation
📝 Walkthrough概要StationAPI サービスを AWS ECS ステージング環境にデプロイする新しい GitHub Actions ワークフローが追加されました。このワークフローは手動トリガーまたはマスターブランチへのプッシュで起動し、Docker イメージを構築して Amazon ECR にプッシュし、ECS タスク定義を更新して、指定されたサービスをデプロイします。 変更内容ECS ステージングデプロイメントワークフロー
推定コードレビュー工数🎯 2 (シンプル) | ⏱️ 約10分 詩
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/deploy_ecs_staging_stationapi.yml (1)
24-29: ⚡ Quick win並行実行時に古いコミットが後から反映される競合を防いでください
concurrency未設定のため、連続 push でデプロイが競合し、古い SHA が最後に適用される可能性があります。staging デプロイは直列化しておく方が安全です。差分案
jobs: deploy: name: Deploy StationAPI Staging runs-on: self-hosted environment: staging + concurrency: + group: staging-stationapi-${{ github.ref }} + cancel-in-progress: true🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/deploy_ecs_staging_stationapi.yml around lines 24 - 29, deploy ジョブ(job 名 "deploy", environment: staging)で並行実行を制御しておらず、連続 push 時に古い SHA が後から適用される競合が起きるため、ワークフローかジョブに concurrency 設定を追加して staging デプロイを直列化してください;具体的には deploy ジョブ("name: Deploy StationAPI Staging"/job id "deploy")に対して一意の group 名(例: "deploy-stationapi-staging")を指定し、cancel-in-progress: true を設定して新しい実行が来たら古い進行中の実行をキャンセルするようにしてください。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/deploy_ecs_staging_stationapi.yml:
- Around line 8-14: The workflow currently triggers on changes to source and
config files but misses Docker context; update the on.push.paths in the ECS
staging workflow (.github/workflows/deploy_ecs_staging_stationapi.yml) to
include the Docker build context used by the pipeline (e.g., add "docker/**" or
the exact path where ./docker/api/Dockerfile lives) so pushes that modify
Dockerfile or related docker assets will trigger the deploy; ensure the added
path matches the Docker build reference (./docker/api/Dockerfile) used later in
the job.
- Around line 32-33: The workflow currently pins actions with floating version
tags (e.g., "actions/checkout@v4", "aws-actions/configure-aws-credentials@v4",
"aws-actions/amazon-ecr-login@v2",
"aws-actions/amazon-ecs-render-task-definition@v1",
"aws-actions/amazon-ecs-deploy-task-definition@v2"); replace each of those
`uses:` references with the corresponding commit SHA for that action (e.g.,
"actions/checkout@<commit-sha>") so the deploy workflow is deterministic and
reproducible—update the five occurrences matching those exact strings in the
file to use the proper commit SHAs instead of version tags.
- Around line 24-29: Replace the long-lived AWS access key usage in the Deploy
StationAPI Staging job with the OIDC-based flow by switching the
configure-aws-credentials step to use role-to-assume (the OIDC role) instead of
environment AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, and set the role-to-assume
value to your IAM role; also add a repository-level permissions block that
includes "id-token: write" and "contents: read" so actions/checkout and OIDC
token exchange work (look for the job named "Deploy StationAPI Staging" and the
configure-aws-credentials invocation to update).
---
Nitpick comments:
In @.github/workflows/deploy_ecs_staging_stationapi.yml:
- Around line 24-29: deploy ジョブ(job 名 "deploy", environment:
staging)で並行実行を制御しておらず、連続 push 時に古い SHA が後から適用される競合が起きるため、ワークフローかジョブに concurrency
設定を追加して staging デプロイを直列化してください;具体的には deploy ジョブ("name: Deploy StationAPI
Staging"/job id "deploy")に対して一意の group 名(例:
"deploy-stationapi-staging")を指定し、cancel-in-progress: true
を設定して新しい実行が来たら古い進行中の実行をキャンセルするようにしてください。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e92bcfe4-726a-493c-9bee-4fda9bbac0d6
📒 Files selected for processing (1)
.github/workflows/deploy_ecs_staging_stationapi.yml
概要
ステージング環境向けの ECS デプロイ用 GitHub Actions ワークフローを追加します。既存の本番環境向けワークフロー(
deploy_ecs_production_stationapi.yml)に対応するステージング版です。変更の種類
変更内容
.github/workflows/deploy_ecs_staging_stationapi.ymlを新規追加masterへの push(.sqlx/**/data/**/scripts/**/stationapi/**/Cargo.lock/Cargo.tomlの変更時)またはworkflow_dispatchでトリガーstagingenvironment を利用し、ECR への docker イメージ push 後に ECS タスク定義を更新してデプロイsecrets経由で参照テスト
cargo fmt --all -- --checkが通ることcargo clippy -- -D warningsが通ることcargo test(SQLX_OFFLINE=true)が通ること省略: コード本体に変更がないため Rust 系の検証は実施していません。
関連Issue
スクリーンショット(任意)
Summary by CodeRabbit
Chores