Skip to content

Commit

Permalink
feat: use shorter names for image tag (#2218)
Browse files Browse the repository at this point in the history
* feat: add workflow to build rolling images

* fix: update workflow name
  • Loading branch information
subomi authored Jan 15, 2025
1 parent c05efab commit 94a7ea6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/build-rolling-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
IMAGE_NAME: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/convoy-rolling-updates
RELEASE_VERSION: ${{ github.sha }}

jobs:
build_ui:
Expand Down Expand Up @@ -48,6 +47,9 @@ jobs:
with:
fetch-depth: 0

- name: Set short hash
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -96,14 +98,19 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-${{ matrix.arch }}
${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }}-${{ matrix.arch }}
build-args: |
ARCH=${{ matrix.arch }}
build-and-push-default:
runs-on: ubuntu-latest
needs: [build-and-push-arch]
steps:
- uses: actions/checkout@v4

- name: Set short hash
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -116,6 +123,6 @@ jobs:

- name: Create and push manifest for version
run: |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }} \
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-amd64 \
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-arm64
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }} \
${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }}-amd64 \
${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }}-arm64

0 comments on commit 94a7ea6

Please sign in to comment.