Switch to Buildah for container builds #51
5 changed files with 15 additions and 9 deletions
Switch container builds to indri docker-builder runner
- 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>
commit
2c284ed0cf
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: docker-builder
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
|
|
|||
|
|
@ -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
5
.github/actionlint.yaml
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
self-hosted-runner:
|
||||
labels:
|
||||
- docker-builder
|
||||
- ubuntu-latest
|
||||
- ubuntu-22.04
|
||||
|
|
@ -86,4 +86,5 @@ repos:
|
|||
rev: v1.7.10
|
||||
hooks:
|
||||
- id: actionlint-system
|
||||
args: ['-config-file', '.github/actionlint.yaml']
|
||||
files: ^\.forgejo/workflows/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue