Skip to content

Commit

Permalink
workflow_dispatch can tag container as latest
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Jul 20, 2022
1 parent 7ebd2e0 commit ba4e11f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/docker.yml
Expand Up @@ -10,6 +10,11 @@ on:
inputs:
tag:
required: true
type: string
latest:
default: false
type: boolean


env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -50,9 +55,14 @@ jobs:
if [ x"$TAG" != x"" ];then
echo "::set-output name=tag::${FULL_TAG}"
fi
if [ x"$LATEST" = x"true" ]; then
echo "::set-output name=latest::${LATEST_TAG}"
fi
env:
FULL_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}
LATEST_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
TAG: ${{ github.event.inputs.tag }}
LATEST: ${{ github.event.inputs.latest }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
Expand All @@ -65,5 +75,6 @@ jobs:
tags: |
${{ steps.meta.outputs.tags }}
${{ steps.dispatch_tag.outputs.tag }}
${{ steps.dispatch_tag.outputs.latest }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit ba4e11f

Please sign in to comment.