diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28184fd..bce35d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,6 +101,10 @@ jobs: uses: docker/metadata-action@v4 with: images: somleng/sms-gateway + tags: | + # set latest tag for main branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + type=raw,value=${{ steps.release-please.outputs.tag_name }} - name: Build and push Docker image if: ${{ steps.release-please.outputs.release_created }} @@ -108,5 +112,5 @@ jobs: with: context: . push: true - tags: ${{ steps.release-please.outputs.tag_name }}, latest + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}