From 577509699d5b28eb1fc175edd3feb302868b56fe Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Larsen Date: Tue, 10 Oct 2023 10:29:57 +0200 Subject: [PATCH] Enable pushing to ghcr.io on merge to master Signed-off-by: Mikkel Oscar Lyderik Larsen --- .github/workflows/gh-packages.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-packages.yaml b/.github/workflows/gh-packages.yaml index bd534b14..2d319683 100644 --- a/.github/workflows/gh-packages.yaml +++ b/.github/workflows/gh-packages.yaml @@ -3,6 +3,8 @@ permissions: {} on: push: + branches: + - master tags: - '*' @@ -73,6 +75,17 @@ jobs: context: . build-args: BASE_IMAGE=alpine:3 platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + # Build and push latest tag + - name: Build and push latest + uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 + with: + context: . + build-args: BASE_IMAGE=alpine:3 + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + labels: ${{ steps.meta.outputs.labels }}