Skip to content

Commit

Permalink
feat(ci): auto generate image version (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChandonPierre committed Oct 2, 2024
1 parent 03cf550 commit ff9e604
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
on:
workflow_dispatch:
inputs:
version:
description: Version to tag the container with
required: true
type: string
publish:
description: Publish the container to the registry
required: true
Expand Down Expand Up @@ -48,8 +44,11 @@
make build-webui-image
make build-image-dirty
- name: Set image tag
run: echo "VERSION=$(git describe --tags --match 'v2.*' --exclude '*-' --abbrev=0)" >> $GITHUB_ENV

- name: Push image
if: ${{inputs.publish}}
run: |
docker tag traefik/traefik ghcr.io/${{ github.repository }}:${{ inputs.version }}-${GITHUB_SHA::7}
docker tag traefik/traefik ghcr.io/${{ github.repository }}:${VERSION}-${GITHUB_SHA::7}
docker push ghcr.io/${{ github.repository }}:${{ inputs.version }}-${GITHUB_SHA::7}

0 comments on commit ff9e604

Please sign in to comment.