Features/buildah build (#159)

* feat(oci): Build using pure Buildah
This commit is contained in:
2025-08-13 10:20:48 +02:00
committed by GitHub
parent 90eda75219
commit 9f75f874d1
2 changed files with 26 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
name: Build OCI image
name: Build and push OCI image
on:
push:
@@ -8,32 +8,36 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
VERSION: ${{ github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ghcr.io/katenary/katenary
tags: latest ${{ github.ref_name }}
containerfiles: |
./oci/katenary/Containerfile
build-args: |
VERSION=${{ github.ref_name }}
- name: Install Buildah
run: |-
if ! comamnd -v buildah 2>/dev/null; then
echo "Install Buildah"
sudo apt-get update
sudo apt-get install -y buildah
else
echo "Buildah already installed"
fi
- name: Build and tag
run: |-
buildah build --build-arg VERSION=$VERSION -t katenary -f ./oci/katenary/Containerfile .
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:$VERSION
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:latest
- name: Push image
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
run: |-
buildah login $REGISTRY -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
buildah push $REGISTRY/${IMAGE_NAME,,}:$VERSION
buildah push $REGISTRY/${IMAGE_NAME,,}:latest

View File

@@ -20,7 +20,7 @@ FROM scratch
LABEL org.opencontainers.image.source=https://github.com/katenary/katenary
LABEL org.opencontainers.image.description="Katenary converts compose files to Helm Chart"
LABEL org.opencontainers.image.licenses=MIT
COPY --from=builder /go/src/github.com/katenary/katenary/katenary /usr/local/bin/katenary
COPY --from=builder /go/src/github.com/katenary/katenary/katenary /katenary
VOLUME /project
WORKDIR /project
ENTRYPOINT ["/usr/local/bin/katenary"]
ENTRYPOINT ["/katenary"]