Commit 8d89aad 1 parent 068dd01 commit 8d89aad Copy full SHA for 8d89aad
File tree 4 files changed +54
-0
lines changed
4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Push image
2
+ on :
3
+ workflow_call :
4
+ inputs :
5
+ ECR_REGION :
6
+ required : true
7
+ type : string
8
+ ECR_REPOSITORY :
9
+ required : true
10
+ type : string
11
+ secrets :
12
+ ECR_ROLE_TO_ASSUME :
13
+ required : true
14
+
15
+
16
+ jobs :
17
+ ecr :
18
+ runs-on : ubuntu-latest
19
+ permissions :
20
+ id-token : write # This is required for requesting the JWT
21
+ contents : read # This is required for actions/checkout
22
+ steps :
23
+ # Checkout GitHub repository
24
+ - uses : actions/checkout@v3
25
+
26
+ # Assume role in Cloud Platform
27
+ - uses : aws-actions/configure-aws-credentials@v2
28
+ with :
29
+ role-to-assume : ${{ secrets.ECR_ROLE_TO_ASSUME }}
30
+ aws-region : ${{ inputs.ECR_REGION }}
31
+
32
+ # Login to container repository
33
+ - uses : aws-actions/amazon-ecr-login@v1
34
+ id : login-ecr
35
+
36
+ # Build and push a Docker image to the container repository
37
+ - run : |
38
+ docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
39
+ docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
40
+ env:
41
+ REGISTRY: ${{ steps.login-ecr.outputs.registry }}
42
+ REPOSITORY: ${{ inputs.ECR_REPOSITORY }}
43
+ IMAGE_TAG: ${{ github.sha }}
Original file line number Diff line number Diff line change
1
+ on : push
2
+ jobs :
3
+ build-and-push :
4
+ uses : ./.github/workflows/build-and-push.yml
5
+ with :
6
+ ECR_REGION : ${{vars.ECR_REGION}}
7
+ ECR_REPOSITORY : ${{vars.ECR_REPOSITORY}}
8
+ secrets :
9
+ ECR_ROLE_TO_ASSUME : ${{ secrets.ECR_ROLE_TO_ASSUME }}
Original file line number Diff line number Diff line change 8
8
* .code-workspace
9
9
* .sha256
10
10
terraform.tfstate
11
+ .idea
Original file line number Diff line number Diff line change
1
+ FROM python:3.12-slim
You can’t perform that action at this time.
0 commit comments