diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c901d16d..6e476ee6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -46,6 +46,20 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + freqtradeorg/frequi + ghcr.io/freqtrade/frequi + # generate Docker tags based on the following events/attributes + tags: | + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + type=semver,pattern={{version}} + + - name: Build and push Docker image id: build-and-push uses: docker/build-push-action@v6 @@ -53,8 +67,4 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 context: . push: true - tags: | - ${{ github.ref == 'refs/heads/main' && 'freqtradeorg/frequi:latest' || '' }} - ${{ github.ref == 'refs/heads/main' && 'ghcr.io/freqtrade/frequi:latest' || '' }} - ${{ github.event_name == 'release' && github.event.release.tag_name != '' && format('freqtradeorg/frequi:{0}', github.event.release.tag_name) || '' }} - ${{ github.event_name == 'release' && github.event.release.tag_name != '' && format('ghcr.io/freqtrade/frequi:{0}', github.event.release.tag_name) || '' }} + tags: ${{ steps.meta.outputs.tags }}