テンプレート一覧に戻る
GitHub Actions
GitHub Actions CI/CDワークフローのプロジェクト向けCLAUDE.md。効率的なCI/CDパイプライン構築に最適です。
中級github-actionsci-cddevopsautomation
CLAUDE.md
# プロジェクト名
GitHub Actions で管理されたCI/CDパイプライン。
## 技術スタック
- **CI/CD**: GitHub Actions
- **ランナー**: ubuntu-latest / macos-latest
- **キャッシュ**: actions/cache
- **セキュリティ**: OIDC / Secrets / Environments
## コマンド
| コマンド | 用途 |
|---------|------|
| `gh workflow run <workflow>` | 手動ワークフロー実行 |
| `gh run list` | 実行履歴確認 |
| `gh run view <run-id>` | 実行詳細確認 |
| `act` | ローカルテスト実行 |
| `gh workflow list` | ワークフロー一覧 |
## ディレクトリ構造
| パス | 役割 |
|-----|------|
| `.github/workflows/` | ワークフロー定義(YAML) |
| `.github/actions/` | カスタムCompositeアクション |
| `.github/CODEOWNERS` | コードオーナー定義 |
| `.github/dependabot.yml` | Dependabot設定 |
## コーディング規約
- ワークフローファイルは用途別に分割(ci.yml, deploy.yml等)
- actions/checkout@v4 等はメジャーバージョンでピン留め
- シークレットは `${{ secrets.XXX }}` で参照、ログに出力しない
- キャッシュキーにhashFiles()を含める
- concurrencyグループで同時実行を制御
- 環境保護ルール(production環境の手動承認等)
## Git規約
- ブランチ: `feature/`, `fix/`, `chore/`
- コミットメッセージ: Conventional Commits形式