@@ -17,51 +17,22 @@ jobs:
1717 - name : Setup job workspace
1818 uses : ServerlessOpsIO/gha-setup-workspace@v1
1919
20- - name : Assume AWS credentials
20+ - name : Assume AWS Credentials
2121 uses : ServerlessOpsIO/gha-assume-aws-credentials@v1
2222 with :
2323 build_aws_account_id : ${{ secrets.AWS_CICD_ACCOUNT_ID }}
2424
25- - name : Install AWS SAM
26- uses : aws-actions/setup-sam@v2
27-
28- - name : Validate template
29- run : sam validate --lint
30-
31- - name : Build deployment artifact
32- run : sam build
33-
34- - name : Store artifacts
35- uses : ServerlessOpsIO/gha-store-artifacts@v1
36- with :
37- use_aws_sam : true
38-
39- deploy :
40- needs :
41- - build
42-
43- environment : production
44- runs-on : ubuntu-latest
45- permissions :
46- id-token : write
47- contents : read
48-
49- steps :
50- - name : Setup job workspace
51- uses : ServerlessOpsIO/gha-setup-workspace@v1
52- with :
53- checkout_artifact : true
54-
55- - name : Assume AWS credentials
56- uses : ServerlessOpsIO/gha-assume-aws-credentials@v1
57- with :
58- build_aws_account_id : ${{ secrets.AWS_CICD_ACCOUNT_ID }}
59- deploy_aws_account_id : ${{ secrets.DEPLOYMENT_ACCOUNT_ID }}
60-
61- - name : Deploy via AWS SAM
62- uses : ServerlessOpsIO/gha-deploy-aws-sam@v1
25+ - name : Build container image
26+ uses : kciter/aws-ecr-action@v4
6327 with :
64- aws_account_id : ${{ secrets.DEPLOYMENT_ACCOUNT_ID }}
65- env_json : ${{ toJson(env) }}
66- vars_json : ${{ toJson(vars) }}
67- secrets_json : ${{ toJson(secrets) }}
28+ account_id : ${{ secrets.AWS_CICD_ACCOUNT_ID }}
29+ region : ${{ env.AWS_REGION }}
30+ tags : latest,${{ env.GITHUB_EVENT_REF_SLUG }},${{ env.GITHUB_SHA_SHORT }},${{ env.GITHUB_SHA }}
31+ repo : ${{ env.GITHUB_REPOSITORY_OWNER_PART_SLUG }}/${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG}}
32+ create_repo : true
33+ # FIXME: This is a workaround to deal with how the action works and so we can
34+ # continue to use the aws-actions/configure-aws-credentials
35+ access_key_id : ${{ env.AWS_ACCESS_KEY_ID }}
36+ secret_access_key : ${{ env.AWS_SECRET_ACCESS_KEY }}
37+ set_repo_policy : true
38+ repo_policy_file : .github/workflows/ecr-policy.json
0 commit comments