Skip to content

Add web preview and GHCR image build #1

Add web preview and GHCR image build

Add web preview and GHCR image build #1

name: Build reComputer AI Lab Project Images
on:
push:
branches: [main]
paths:
- ".github/workflows/build-ghcr-images.yml"
- "docker/hailo8/retail_shelf_detection.dockerfile"
- "pi_project/retail_shelf_detection/**"
workflow_dispatch:
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: seeed-projects/recomputer-ai-lab-project/retail_shelf_detection
SOURCE_REPOSITORY: https://github.com/Seeed-Projects/reComputer-AI-Lab-Project
jobs:
build-retail-shelf-detection:
name: Build retail_shelf_detection
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=sha-
labels: |
org.opencontainers.image.title=retail_shelf_detection
org.opencontainers.image.description=Retail shelf detection for Raspberry Pi 5 and Hailo-8
org.opencontainers.image.source=${{ env.SOURCE_REPOSITORY }}
- name: Build and push linux/arm64 image
uses: docker/build-push-action@v6
with:
context: ./pi_project/retail_shelf_detection
file: ./docker/hailo8/retail_shelf_detection.dockerfile
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=retail_shelf_detection
cache-to: type=gha,mode=max,scope=retail_shelf_detection
provenance: false