33 push :
44 branches :
55 - master
6+ - main
67 - test
78
89jobs :
10+ test :
11+ uses : ./.github/workflows/_test.yml
912 build :
1013 name : build
1114 permissions :
@@ -15,38 +18,38 @@ jobs:
1518 outputs :
1619 image-tag : " ${{ steps.login-ecr.outputs.registry }}/sponsor-app:${{ github.sha }}"
1720 steps :
18- - uses : docker/setup-buildx-action@v2
19- - uses : actions/checkout@v4
21+ - uses : docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0
22+ - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2023 # - uses: ruby/setup-ruby@v1
2124 # with:
2225 # ruby-version: '3.1'
2326 # bundler-cache: true
24- - uses : aws-actions/configure-aws-credentials@v4
27+ - uses : aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
2528 with :
2629 aws-region : " us-west-2"
2730 role-skip-session-tagging : true
2831 role-to-assume : " arn:aws:iam::005216166247:role/GhaDockerPush"
2932 mask-aws-account-id : false
3033 - id : login-ecr
31- uses : aws-actions/amazon-ecr-login@v2
34+ uses : aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
3235 - run : " echo '${{ github.sha }}' > REVISION"
3336 - name : ' Build Docker image'
34- uses : ' docker/build-push-action@v3 '
37+ uses : ' docker/build-push-action@1104d471370f9806843c095c1db02b5a90c5f8b6 ' # v3.3.1
3538 with :
3639 context : ' .'
3740 load : true
3841 tags : " sponsor-app-test:latest,${{ steps.login-ecr.outputs.registry }}/sponsor-app:${{ github.sha }},${{ steps.login-ecr.outputs.registry }}/sponsor-app:latest"
3942 cache-from : type=gha
4043 cache-to : type=gha,mode=max
4144 - name : ' Push Docker image'
42- uses : ' docker/build-push-action@v3 '
45+ uses : ' docker/build-push-action@1104d471370f9806843c095c1db02b5a90c5f8b6 ' # v3.3.1
4346 with :
4447 context : ' .'
4548 push : true
4649 tags : " ${{ steps.login-ecr.outputs.registry }}/sponsor-app:${{ github.sha }},${{ steps.login-ecr.outputs.registry }}/sponsor-app:latest"
4750
4851 deploy-prod :
49- if : " ${{ success() && github.event_name == 'push' }}"
52+ if : " ${{ success() && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') }}"
5053 name : deploy-prod
5154 needs : ["build"]
5255 permissions :
@@ -62,13 +65,13 @@ jobs:
6265 env :
6366 BUNDLE_GEMFILE : " ${{ github.workspace }}/deploy/Gemfile"
6467 steps :
65- - uses : actions/checkout@v4
66- - uses : ruby/setup-ruby@v1
68+ - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
69+ - uses : ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
6770 with :
6871 ruby-version : ' 3.2'
6972 bundler-cache : true
70- - uses : hashicorp/setup-terraform@v3
71- - uses : aws-actions/configure-aws-credentials@v4
73+ - uses : hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
74+ - uses : aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
7275 with :
7376 aws-region : " us-west-2"
7477 role-skip-session-tagging : true
0 commit comments