From 1efcb882619a90ed0f9355cd8485f7aa80ebb324 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Wed, 19 Mar 2025 08:51:09 -0400 Subject: Try using ko to build images Signed-off-by: Xe Iaso --- .github/workflows/docker.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to '.github') diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 958f9eb..5aa85db 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,6 +8,9 @@ on: pull_request: branches: [ "main" ] +env: + DOCKER_METADATA_SET_OUTPUT_ENV: "true" + permissions: contents: read packages: write @@ -20,6 +23,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-tags: true + fetch-depth: 0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -27,6 +33,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - uses: actions/setup-go@v5 + with: + go-version: '1.24.x' + + - uses: ko-build/setup-ko@v0.8 + - name: Log into registry uses: docker/login-action@v3 with: @@ -42,16 +54,8 @@ jobs: - name: Build and push id: build - uses: docker/build-push-action@v6 - with: - context: . - cache-to: type=gha - cache-from: type=gha - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: linux/arm64/v8,linux/amd64 - sbom: true - push: true + run: | + go run ./cmd/containerbuild --docker-repo ghcr.io/techarohq/anubis --slog-level debug - name: Generate artifact attestation uses: actions/attest-build-provenance@v2 -- cgit v1.2.3