-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.57 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CDK Deploy
on:
push:
branches:
- main # mainブランチへのpushでトリガー
pull_request:
branches:
- main # mainブランチへのPRでトリガー
env:
AWS_REGION : "ap-northeast-1"
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/arm64
# リポジトリをクローンする
- name: Checkout repository
uses: actions/checkout@v4
# AWS の認証
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_REGION }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
# CDK 環境のセットアップ
- name: Install AWS CDK
run: bun install --global aws-cdk
# 必要な依存関係をインストール
- name: Install dependencies
run: bun install --yarn
# CDK デプロイ
- name: Deploy CDK Stack (dev)
if: contains(github.event_name, 'pull_request')
run: cdk deploy -c env=dev --require-approval never
# CDK デプロイ
- name: Deploy CDK Stack (prod)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: cdk deploy -c env=prod --require-approval never