Files
check-printing/.github/workflows/docker-build.yml
T
steve a52244af39 Fix missing latest tag causing Portainer deploy failure
docker-compose pulls :latest but the workflow only pushed branch-name
tags (e.g. :main) and SHA tags -- never :latest. Portainer stacks
reported "manifest unknown" when trying to pull the image.

Add type=raw,value=latest scoped to the default branch so pushes to
main now also tag the image as :latest.
2026-03-12 13:51:04 -06:00

56 lines
1.4 KiB
YAML

name: Build and push Docker image
on:
push:
branches: [main]
tags: ['v*']
workflow_dispatch:
env:
IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/check-printing
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
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@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=sha-
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max