-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.62 KB
/
main.yml
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
59
60
61
62
63
64
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
AWS_REGION: "us-east-1"
permissions:
id-token: write
contents: read
jobs:
AssumeRoleAndCDKDeploy:
runs-on: ubuntu-latest
steps:
- name: Git clone the repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::533266994320:role/administrator
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}
- name: Set AWS account ID
run: echo "AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)" >> $GITHUB_ENV
- name: Sts GetCallerIdentity
run: aws sts get-caller-identity
- name: Build Blog
run: |
npm install --frozen-lockfile
npm run build
- name: List contents of doc_build
run: ls -R ./doc_build
- name: build cdk services
run: |
cd ./services/vite-remix
npm install --frozen-lockfile
npm run build
npm run zip
- name: install build and deploy cdk
run: |
cd ./cdk
npm install --frozen-lockfile
npm run build
npx cdk bootstrap aws://$AWS_ACCOUNT_ID/$AWS_REGION
npx cdk deploy --all --require-approval never
env:
AWS_REGION: ${{ env.AWS_REGION }}
AWS_ACCOUNT_ID: ${{ env.AWS_ACCOUNT_ID }}