Switch to Buildah for container builds #51

Merged
eblume merged 30 commits from feature/p5-container-builds into main 2026-01-24 13:30:26 -08:00
5 changed files with 15 additions and 9 deletions
Showing only changes of commit 2c284ed0cf - Show all commits

Switch container builds to indri docker-builder runner
Some checks failed
Test CI / test (pull_request) Successful in 3s
Build forgejo-runner / build (push) Failing after 0s

- Use Docker instead of buildah in composite action
- Build workflows now run on docker-builder label
- Add actionlint config for custom runner labels
- Avoids nested containerization complexity in k8s

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Erich Blume 2026-01-24 08:49:02 -08:00

View file

@ -1,5 +1,5 @@
name: 'Build and Push Image'
description: 'Build a container image with Buildah and push to zot registry'
description: 'Build a container image with Docker and push to zot registry'
# TODO: Investigate zot tag immutability to prevent overwriting released versions
# See: https://zotregistry.dev/v2.1.1/articles/immutable-tags/
@ -26,11 +26,11 @@ inputs:
runs:
using: 'composite'
steps:
- name: Build image with Buildah
- name: Build image with Docker
shell: bash
run: |
echo "Building ${{ inputs.image_name }}:${{ inputs.version }}"
buildah bud \
docker build \
--tag ${{ inputs.registry }}/${{ inputs.image_name }}:${{ inputs.version }} \
--tag ${{ inputs.registry }}/${{ inputs.image_name }}:${{ github.sha }} \
--file ${{ inputs.context }}/${{ inputs.dockerfile }} \
@ -40,15 +40,15 @@ runs:
shell: bash
run: |
echo "Pushing ${{ inputs.image_name }}:${{ inputs.version }}"
buildah push ${{ inputs.registry }}/${{ inputs.image_name }}:${{ inputs.version }}
buildah push ${{ inputs.registry }}/${{ inputs.image_name }}:${{ github.sha }}
docker push ${{ inputs.registry }}/${{ inputs.image_name }}:${{ inputs.version }}
docker push ${{ inputs.registry }}/${{ inputs.image_name }}:${{ github.sha }}
- name: Summary
shell: bash
run: |
echo "Built and pushed:"
echo "Built and pushed:"
echo " ${{ inputs.registry }}/${{ inputs.image_name }}:${{ inputs.version }}"
echo " ${{ inputs.registry }}/${{ inputs.image_name }}:${{ github.sha }}"
echo ""
echo "Registry tags:"
curl -sf "https://${{ inputs.registry }}/v2/${{ inputs.image_name }}/tags/list" | jq -r '.tags[]' | sort -V | tail -10
curl -sf "https://${{ inputs.registry }}/v2/${{ inputs.image_name }}/tags/list" | jq -r '.tags[]' | sort -V | tail -10 || true

View file

@ -12,7 +12,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
runs-on: docker-builder
steps:
- name: Checkout
uses: actions/checkout@v4

View file

@ -12,7 +12,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
runs-on: docker-builder
steps:
- name: Checkout
uses: actions/checkout@v4

5
.github/actionlint.yaml vendored Normal file
View file

@ -0,0 +1,5 @@
self-hosted-runner:
labels:
- docker-builder
- ubuntu-latest
- ubuntu-22.04

View file

@ -86,4 +86,5 @@ repos:
rev: v1.7.10
hooks:
- id: actionlint-system
args: ['-config-file', '.github/actionlint.yaml']
files: ^\.forgejo/workflows/