mirror of
https://github.com/cstaelen/tidarr.git
synced 2026-10-19 01:30:57 -05:00
* Add multi-platform docker image support (#420) * bump 0.4.4 * add buildx command --------- Co-authored-by: Morteza PRK <mortezaPRK@users.noreply.github.com>
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
name: Publish Docker image
|
|
|
|
on:
|
|
release:
|
|
types: [published, edited]
|
|
|
|
jobs:
|
|
push_to_registry:
|
|
name: Push Docker image to Docker Hub
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DOCKER_PLATFORMS: linux/amd64,linux/arm64
|
|
steps:
|
|
- name: Check out the repo
|
|
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: Log in to Docker Hub
|
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
|
with:
|
|
images: cstaelen/tidarr
|
|
|
|
- name: Build and push pre-release docker image
|
|
if: ${{ github.event.release.prerelease }}
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
file: ./docker/Dockerfile.prod
|
|
platforms: ${{ env.DOCKER_PLATFORMS }}
|
|
push: true
|
|
build-args: VERSION=${{ github.ref_name }}
|
|
tags: cstaelen/tidarr:prerelease
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Build and push release docker image
|
|
if: ${{ !github.event.release.prerelease }}
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
file: ./docker/Dockerfile.prod
|
|
platforms: ${{ env.DOCKER_PLATFORMS }}
|
|
push: true
|
|
build-args: VERSION=${{ github.ref_name }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Update repo description
|
|
uses: peter-evans/dockerhub-description@v4
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
enable-url-completion: true
|
|
short-description: ${{ github.event.repository.description }}
|
|
repository: cstaelen/tidarr
|