diff --git a/.github/workflows/dockerize.yml b/.github/workflows/dockerize.yml index e0e63ccd..bc2da688 100644 --- a/.github/workflows/dockerize.yml +++ b/.github/workflows/dockerize.yml @@ -16,7 +16,8 @@ on: workflow_dispatch: env: - DOCKER_IMAGE_TAG: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }} + # Tag Image with tag name on release, else with 'pre' if push to master + DOCKER_IMAGE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || 'pre' }} jobs: build: @@ -47,7 +48,9 @@ jobs: file: Dockerfile platforms: linux/amd64, linux/arm64 push: true - tags: ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} + tags: | + ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} + ${{ github.ref_type == 'tag' && 'ghcr.io/${{ github.repository }}-cloud:latest' || '' }} build-args: | VERSION=${{ steps.hatch.outputs.version }} PORT=42110 diff --git a/.github/workflows/dockerize_production.yml b/.github/workflows/dockerize_production.yml index a0b86981..a42aa8d9 100644 --- a/.github/workflows/dockerize_production.yml +++ b/.github/workflows/dockerize_production.yml @@ -20,7 +20,8 @@ on: workflow_dispatch: env: - DOCKER_IMAGE_TAG: ${{ github.event_name == 'pull_request' && 'dev' || (github.ref == 'refs/heads/master' && 'latest' || github.ref_name) }} + # Tag Image with tag name on release, else with 'pre' if push to master else with 'dev' if push to PR branch + DOCKER_IMAGE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || github.event_name == 'pull_request' && 'dev' || 'pre' }} jobs: build: @@ -51,7 +52,9 @@ jobs: file: prod.Dockerfile platforms: linux/amd64 push: true - tags: ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }} + tags: | + ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }} + ${{ github.ref_type == 'tag' && 'ghcr.io/${{ github.repository }}-cloud:latest' || '' }} build-args: | VERSION=${{ steps.hatch.outputs.version }} PORT=42110