File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and upload docker images
2+
3+ on :
4+ push :
5+ branches :
6+ - ' **'
7+
8+ permissions :
9+ id-token : write # for JWT request
10+ contents : read # for actions/checkout
11+
12+ jobs :
13+ docker-image-build :
14+ name : docker-image-build
15+ runs-on : ubuntu-latest
16+ environment : preprod
17+ steps :
18+ - name : Checkout repo
19+ uses : actions/checkout@v4.1.7
20+ - name : Configure AWS Credentials
21+ uses : aws-actions/configure-aws-credentials@v4.0.2
22+ with :
23+ role-to-assume : ${{ vars.AWS_ROLE_TO_ASSUME }}
24+ aws-region : eu-west-2
25+ role-session-name : github-aws-access
26+ - name : Login to Amazon ECR
27+ id : login-ecr
28+ uses : aws-actions/amazon-ecr-login@v2.0.1
29+ - name : Build fb-user-datastore, tag, and push docker image to Amazon ECR
30+ env :
31+ REGISTRY : ${{ steps.login-ecr.outputs.registry }}
32+ REPOSITORY : " fb-user-datastore"
33+ IMAGE_TAG : ${{ github.sha }}
34+ run : |
35+ docker build -t ${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }} .
36+ docker tag ${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
37+ docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
You can’t perform that action at this time.
0 commit comments