Browse Source

Go back to using github.sha for tag everywhere

prod-pipeline-testing
Sam Seed 2 years ago
parent
commit
3c4d6b1884
  1. 12
      .github/workflows/aws_deploy.yml

12
.github/workflows/aws_deploy.yml

@ -86,23 +86,15 @@ jobs:
id: timestamp id: timestamp
run: echo "timestamp=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV run: echo "timestamp=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
- name: Checkout at release tag - name: Get additional tag
uses: actions/checkout@v3
if: inputs.environment == 'production'
with:
ref: ${{ inputs.release_tag }}
- name: Get tags
id: tags
run: | run: |
echo "commit-tag=$(if [[ ${{ inputs.environment }} == 'production' ]]; then echo $(git log -1 '--format=format:%H'); else echo ${{ github.sha }}; fi)" >> $GITHUB_ENV
echo "additional-tag=$(if [[ ${{ inputs.environment }} == 'production' ]]; then echo ${{ inputs.release_tag }}-${{ env.timestamp }}; else echo ${{ env.timestamp }}; fi)" >> $GITHUB_ENV echo "additional-tag=$(if [[ ${{ inputs.environment }} == 'production' ]]; then echo ${{ inputs.release_tag }}-${{ env.timestamp }}; else echo ${{ env.timestamp }}; fi)" >> $GITHUB_ENV
- name: Add environment tag to existing image - name: Add environment tag to existing image
id: update-image-tags id: update-image-tags
env: env:
registry: ${{ steps.ecr-login.outputs.registry }} registry: ${{ steps.ecr-login.outputs.registry }}
commit_tag: ${{ env.commit-tag }} commit_tag: ${{ github.sha }}
readable_tag: ${{ inputs.environment }}-${{ env.additional-tag }} readable_tag: ${{ inputs.environment }}-${{ env.additional-tag }}
run: | run: |
manifest=$(aws ecr batch-get-image --repository-name $repository --image-ids imageTag=$commit_tag --output text --query images[].imageManifest) manifest=$(aws ecr batch-get-image --repository-name $repository --image-ids imageTag=$commit_tag --output text --query images[].imageManifest)

Loading…
Cancel
Save