name: Build Containers on: workflow_call: inputs: tag: required: true type: string tags: required: false type: string ref: required: false type: string secrets: DOCKERHUB_USERNAME: required: true DOCKERHUB_TOKEN: required: true jobs: publish: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: ref: ${{ inputs.ref || github.sha }} - name: Log in to the Container registry (ghcr.io) uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Log in to the Container registry (dockerhub) uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - uses: depot/setup-action@91bc8495a33ebfc504ffc89e5674379ccf23c29c # v1 - name: Generate Docker metadata id: meta uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6 with: images: | hkotel/mealie ghcr.io/${{ github.repository }} # Overwrite the image.version label with our tag labels: | org.opencontainers.image.version=${{ inputs.tag }} org.opencontainers.image.revision=${{ inputs.ref || github.sha }} - name: Retrieve Python package uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 with: name: backend-dist path: dist - name: Build and push Docker image, via Depot.dev uses: depot/build-push-action@0f27be7c41d76663a98518dfe68f1c46582242c4 # 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 }} labels: ${{ steps.meta.outputs.labels }} build-args: | COMMIT=${{ inputs.ref || github.sha }}