File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Deploy Apps
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ jobs :
7+ build :
8+ name : Build and Push to ECR with Docker Buildx Cache
9+ runs-on : ubuntu-latest
10+ permissions :
11+ contents : read
12+ id-token : write
13+
14+ strategy :
15+ matrix :
16+ service : [aws-gateway-controller]
17+
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v4
21+
22+ - name : Set up Docker Buildx
23+ uses : docker/setup-buildx-action@v3
24+
25+ - name : Configure AWS credentials from OIDC
26+ uses : aws-actions/configure-aws-credentials@v4
27+ with :
28+ aws-region : ap-northeast-1
29+ role-to-assume : ${{ vars.AWS_ROLE_ARN }}
30+ role-session-name : GitHubActions
31+
32+ - name : Login to Amazon ECR
33+ uses : aws-actions/amazon-ecr-login@v2
34+
35+ - name : Build and push Docker image with Buildx
36+ run : |
37+ docker buildx build \
38+ -t "${{ vars.AWS_ACCOUNT_ID }}.dkr.ecr.ap-northeast-1.amazonaws.com/${{ matrix.service }}:${{github.sha}}" \
39+ -t "${{ vars.AWS_ACCOUNT_ID }}.dkr.ecr.ap-northeast-1.amazonaws.com/${{ matrix.service }}:latest" \
40+ --push \
41+ .
You can’t perform that action at this time.
0 commit comments