chore: use docker-metadata-action

This commit is contained in:
Matthias 2024-10-31 19:32:34 +01:00
parent acf2426d8b
commit d3afd9087f

View File

@ -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 }}