mealie/.github/workflows/partial-builder.yml
Michael Chisholm c0ab7673ba
dev: Create a Python package, build Docker images from it (#4551)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2025-02-11 09:28:40 -06:00

69 lines
1.7 KiB
YAML

name: Build Containers
on:
workflow_call:
inputs:
tag:
required: true
type: string
tags:
required: false
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
build-package:
name: "Build Python package"
uses: ./.github/workflows/partial-package.yml
with:
tag: ${{ inputs.tag }}
publish:
needs: build-package
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry (ghcr.io)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry (dockerhub)
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: depot/setup-action@v1
- name: Retrieve Python package
uses: actions/download-artifact@v4
with:
name: backend-dist
path: dist
- name: Build and push Docker image, via Depot.dev
uses: depot/build-push-action@v1
with:
project: srzjb6mhzm
file: ./docker/Dockerfile
context: .
build-contexts: |
packages=dist
platforms: linux/amd64,linux/arm64
push: true
tags: |
hkotel/mealie:${{ inputs.tag }}
ghcr.io/${{ github.repository }}:${{ inputs.tag }}
${{ inputs.tags }}
build-args: |
COMMIT=${{ github.sha }}