frequi_origin/.github/workflows/docker.yml
2024-10-31 19:25:51 +01:00

56 lines
1.6 KiB
YAML

name: Build and Publish Docker Container
on:
push:
branches:
- main
- docker_container
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
environment:
name: Production
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
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) || '' }}