Skip to content

Commit

Permalink
Fix latest tag
Browse files Browse the repository at this point in the history
  • Loading branch information
felixschndr committed Oct 30, 2024
1 parent 8623132 commit 4be4071
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/publish_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Deploy Images to GitHub Container Registry
on: push

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: ghcr.io/${{ github.repository }}
PLATFORMS: linux/amd64,linux/arm64

jobs:
build-and-push-image:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: "Login to GitHub Container Registry"
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}

Expand All @@ -32,24 +32,25 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ env.PLATFORMS }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image as latest
# if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}:latest
platforms: ${{ env.PLATFORMS }}
tags: ${{ steps.meta.outputs.tags }},${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 4be4071

Please sign in to comment.