Skip to content

Commit

Permalink
🔨 Docker tag use branches name
Browse files Browse the repository at this point in the history
  • Loading branch information
journey-ad committed Jun 26, 2024
1 parent d29ea7f commit 5708711
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

-
name: Extract metadata (tags, labels) for Docker
id: meta
Expand All @@ -29,6 +29,16 @@ jobs:
tags: |
type=raw,value=latest
type=ref,event=tag
-
name: Determine image tag
id: determine_tag
run: |
if [ "${{ github.ref_name }}" == "main" ]; then
echo "::set-output name=tags::${{ steps.meta.outputs.tags }}"
else
echo "::set-output name=tags::journey0ad/bitmagnet-next-web:${{ github.ref_name }}"
fi
-
name: Set up QEMU
Expand All @@ -45,7 +55,7 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.determine_tag.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down

0 comments on commit 5708711

Please sign in to comment.