@@ -18,17 +18,19 @@ jobs:
1818 create_release :
1919 name : Create Release
2020 runs-on : ubuntu-latest
21+ env :
22+ tag : ${{ inputs.tag }}
2123 steps :
2224 - name : Validate Tag Format
2325 run : |
24- if [[ ! "${{ github.event.inputs. tag }} " =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
26+ if [[ ! "$tag" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
2527 echo "Error: Tag must be in the format X.Y.Z (e.g. 1.0.0)"
2628 exit 1
2729 fi
2830
2931 - name : Configure AWS Credentials
3032 id : credentials
31- uses : aws-actions/configure-aws-credentials@v8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
33+ uses : aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
3234 with :
3335 role-to-assume : ${{ secrets.IAM_ROLE }}
3436 aws-region : ${{ vars.AWS_REGION }}
4244 run : |
4345 git config --global user.name "github-actions"
4446 git config --global user.email "github@github.com"
45- git tag ${{ github.event.inputs. tag }}
46- git push origin ${{ github.event.inputs. tag }}
47+ git tag $tag
48+ git push origin $tag
4749
4850 - name : Full Deployment
4951 uses : ./.github/workflows/full-deployment.yml
5557 - name : Re-tag ECR Images with Release Tag
5658 env :
5759 IMAGE_SHA : ${{ github.sha }}
58- IMAGE_TAG : ${{ inputs.tag }}
5960 run : |
6061 repo-list=['deductions/ehr-out-service',
6162 'deductions/ehr-repo',
6970 for repo in "${repo-list[@]}"; do
7071 repo=${{ steps.credentials.outputs.aws-account-id }}.dkr.ecr.eu-west-2.amazonaws.com/$repo
7172 docker pull $repo:$IMAGE_SHA
72- docker tag $repo:$IMAGE_SHA $repo:$IMAGE_TAG
73- docker push $repo:$IMAGE_TAG
73+ docker tag $repo:$IMAGE_SHA $repo:$tag
74+ docker push $repo:$tag
7475 done
7576
7677
0 commit comments