fix(ci): latest docker tag targets the latest tag

Until now, the latest was more a "dev" release, targeting the latest
changes in the main branch instead of the latest stable release.
This commit is contained in:
Bastien Wirtz 2024-10-16 14:05:24 +02:00
parent 64629742f7
commit b760f04962
3 changed files with 8 additions and 14 deletions

View File

@ -25,7 +25,7 @@ jobs:
buildkitd-flags: --debug
-
name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
@ -36,20 +36,14 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
-
name: Set tag name
run: |
if [[ ${{ github.ref_type }} == "tag" ]]; then
echo "IMAGE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
fi
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
tags: |
b4bz/homer:${{env.IMAGE_TAG}}
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
b4bz/homer:latest
b4bz/homer:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
platforms: linux/amd64,linux/arm/v7,linux/arm/v6,linux/arm64

View File

@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v4
-
name: pnpm setup
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4
with:
version: 9
-

View File

@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4
-
name: pnpm setup
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4
with:
version: 9
-