Skip to content

Build Images

Build Images #109

Workflow file for this run

name: Build Images
#on:
# push:
# branches:
# - "master"
on:
workflow_dispatch: {}
schedule:
- cron: '0 0 * * *'
jobs:
build:
name: Build and Push
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
target:
- klipper
- moonraker
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/nelsongraca/kdock-${{ matrix.target }}
tags: latest
labels: |
org.opencontainers.image.title=KDock - ${{ matrix.target }}
org.opencontainers.image.description=Container image for ${{ matrix.target }}
-
name: GHCR Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
-
# # Add support for more platforms with QEMU (optional)
# # https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build ${{ matrix.target }}
uses: docker/build-push-action@v6
with:
platforms: linux/amd64, linux/arm64
context: .
cache-from: type=registry,ref=ghcr.io/nelsongraca/kdock-${{ matrix.target }}:buildcache
cache-to: type=registry,ref=ghcr.io/nelsongraca/kdock-${{ matrix.target }}:buildcache,mode=max
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/nelsongraca/kdock-${{ matrix.target }}:latest
target: ${{ matrix.target }}
-
name: Clean Images
uses: actions/delete-package-versions@v5
with:
package-name: 'kdock-${{ matrix.target }}'
package-type: 'container'
min-versions-to-keep: 0
delete-only-untagged-versions: 'true'