Skip to content

Commit

Permalink
Test docker meta
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-wal committed Jul 18, 2024
1 parent 6eb4d22 commit 21264a1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,32 @@ jobs:
run: |
if [ -n "${{ inputs.version }}" ]
then
IMAGE_TAG="${{ inputs.version }}-${{ github.ref_name }}"
IMAGE_TAG="${{ inputs.version }}"
else
IMAGE_TAG=$(echo ${{ github.ref_name }} | tr '/' '-')
fi
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: name/app

- name: Build tag and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: public.ecr.aws/f4h6r4m9/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
tags: public.ecr.aws/f4h6r4m9/${{ env.ECR_REPOSITORY }}:${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push tag
if: inputs.version != ''
run: |
TAG_NAME="v${{ env.IMAGE_TAG }}"
TAG_NAME="v${{ steps.meta.outputs.tags }}"
git tag $TAG_NAME
git push origin $TAG_NAME

0 comments on commit 21264a1

Please sign in to comment.