From af299733f7ee33f77eda73a4fce6eff7ecc06697 Mon Sep 17 00:00:00 2001 From: scanash00 Date: Fri, 8 Aug 2025 12:13:13 -0800 Subject: [PATCH] fix: use proper Docker Buildx setup with install flag --- .github/workflows/docker.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3ad9434..c7d1f36 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -26,6 +26,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + - name: Log in to Container Registry if: github.event_name != 'pull_request' uses: docker/login-action@v3 @@ -47,21 +52,14 @@ jobs: type=semver,pattern={{major}} type=raw,value=latest,enable={{is_default_branch}} - - name: Build with Kaniko - if: github.event_name != 'pull_request' - uses: aevea/action-kaniko@master + - name: Build and push Docker image + uses: docker/build-push-action@v5 with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - image: ${{ env.IMAGE_NAME }} - tag: ${{ github.ref_name }} - tag_with_latest: ${{ github.ref == 'refs/heads/main' }} - build_args: | + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | SOURCE_COMMIT=${{ github.sha }} - - - name: Build for PR (no push) - if: github.event_name == 'pull_request' - run: | - echo "PR build - image would be built but not pushed" - echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.head_ref }}" + cache-from: type=gha + cache-to: type=gha,mode=max -- 2.51.2