Skip to content

Commit

Permalink
OPSEXP-2764 Push an additional tag with timestamp (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn authored Aug 8, 2024
1 parent 41b3b8e commit de7a2b1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
echo "image_labels=quay.expires-after=2w" >> $GITHUB_OUTPUT
fi
echo "image_created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "timestamp=$(date -u +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
echo "tomcat_version=$(jq -r .tomcat_version tomcat${{ matrix.tomcat_major }}.json)" >> $GITHUB_OUTPUT
echo "tomcat_sha512=$(jq -r .tomcat_sha512 tomcat${{ matrix.tomcat_major }}.json)" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -150,10 +151,20 @@ jobs:
labels: ${{ steps.vars.outputs.image_labels }}
provenance: false

- name: Push Image to docker.io
- name: Push additional timestamped tag to quay.io
if: github.ref_name == 'master'
env:
SRC_IMAGE: quay.io/${{ env.IMAGE_REGISTRY_NAMESPACE }}/${{ env.IMAGE_REPOSITORY }}:${{ steps.vars.outputs.image_tag }}
DST_IMAGE: ${{ env.IMAGE_REGISTRY_NAMESPACE }}/${{ env.IMAGE_REPOSITORY }}:${{ steps.vars.outputs.image_tag }}
DST_IMAGE: quay.io/${{ env.IMAGE_REGISTRY_NAMESPACE }}/${{ env.IMAGE_REPOSITORY }}:${{ steps.vars.outputs.image_tag }}-${{ steps.vars.outputs.timestamp }}
run: |
docker buildx imagetools create ${{ env.SRC_IMAGE }} -t ${{ env.DST_IMAGE }}
- name: Push images to docker.io
if: github.ref_name == 'master'
env:
SRC_IMAGE: quay.io/${{ env.IMAGE_REGISTRY_NAMESPACE }}/${{ env.IMAGE_REPOSITORY }}:${{ steps.vars.outputs.image_tag }}
DST_IMAGE: ${{ env.IMAGE_REGISTRY_NAMESPACE }}/${{ env.IMAGE_REPOSITORY }}:${{ steps.vars.outputs.image_tag }}
run: >-
docker buildx imagetools create ${{ env.SRC_IMAGE }}
-t ${{ env.DST_IMAGE }}
-t ${{ env.DST_IMAGE }}-${{ steps.vars.outputs.timestamp }}

0 comments on commit de7a2b1

Please sign in to comment.