Skip to content

Commit 7ba3679

Browse files
BCDA-9736: tiny improvement to deploy workflow (#1300)
1 parent 387ac8b commit 7ba3679

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/deploy-all.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,45 @@ env:
106106
TENV_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107107

108108
jobs:
109+
verify_images_exist:
110+
environment: ${{ inputs.env || 'dev' }}
111+
runs-on: codebuild-bcda-app-${{github.run_id}}-${{github.run_attempt}}
112+
steps:
113+
- uses: aws-actions/configure-aws-credentials@v4
114+
with:
115+
aws-region: ${{ vars.AWS_REGION }}
116+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/delegatedadmin/developer/${{ vars.AWS_ROLE_TO_ASSUME }}
117+
- name: Verify API image exists
118+
run: |
119+
echo "Verifying that tag ${{ inputs.version }} exists in the bcda-${{ env.RELEASE_ENV }}-api repo"
120+
aws ecr describe-images --repository-name bcda-${{ env.RELEASE_ENV }}-api --image-ids imageTag=${{ inputs.version }}
121+
- name: Verify SSAS image exists
122+
run: |
123+
echo "Verifying that tag ${{ inputs.ssas_version }} exists in the bcda-${{ env.RELEASE_ENV }}-ssas repo"
124+
aws ecr describe-images --repository-name bcda-${{ env.RELEASE_ENV }}-ssas --image-ids imageTag=${{ inputs.ssas_version }}
125+
- name: Verify Worker image exists
126+
run: |
127+
echo "Verifying that tag ${{ inputs.version }} exists in the bcda-${{ env.RELEASE_ENV }}-worker repo"
128+
aws ecr describe-images --repository-name bcda-${{ env.RELEASE_ENV }}-worker --image-ids imageTag=${{ inputs.version }}
129+
109130
migrate_db:
131+
needs: [verify_images_exist]
110132
uses: ./.github/workflows/migrate-db.yml
111133
with:
112134
ref: ${{ inputs.ref }}
113135
env: ${{ inputs.env || 'dev' }}
114136
secrets: inherit
115137

116138
migrate_ssas_db:
139+
needs: [verify_images_exist]
117140
uses: CMSgov/bcda-ssas-app/.github/workflows/migrate-db.yml@main
118141
with:
119142
ref: ${{ inputs.ssas_ref }}
120143
env: ${{ inputs.env || 'dev' }}
121144
secrets: inherit
122145

123146
deploy:
147+
needs: [verify_images_exist]
124148
environment: ${{ inputs.env || 'dev' }}
125149
runs-on: codebuild-bcda-app-${{github.run_id}}-${{github.run_attempt}}
126150
steps:

0 commit comments

Comments
 (0)