Skip to content

Commit

Permalink
fix image tags
Browse files Browse the repository at this point in the history
  • Loading branch information
abe garcia committed Nov 7, 2023
1 parent 2e7e95c commit 2f0e2d5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,23 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set release version
run: echo "RELEASE_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g' | sed 's/+/-/g')" >> $GITHUB_ENV
- name: Set release info
run: |
set -vx
echo "RELEASE_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g' | sed 's/+/-/g')" >> $GITHUB_ENV
if ${{ github.event_name }} != 'released'; then
echo "TAGS=${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
else
echo "TAGS=${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }},${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_ENV
fi
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
tags: ${{ env.TAGS }}
labels: |
org.opencontainers.image.source=https://github.com/${{ env.IMAGE_NAME }}
org.opencontainers.image.version=${{ env.RELEASE_VERSION }}

0 comments on commit 2f0e2d5

Please sign in to comment.