From ff35d9e0efb8f284d1c5de5d3e829db80645ada8 Mon Sep 17 00:00:00 2001 From: xZero707 Date: Tue, 13 Sep 2022 23:23:11 +0200 Subject: [PATCH] Replace build file with docker/bake-action and implement GHA cache --- .github/workflows/image.yml | 19 ++++++++----------- build/bin/build | 3 --- 2 files changed, 8 insertions(+), 14 deletions(-) delete mode 100755 build/bin/build diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 9bdc247..4adf593 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -11,15 +11,6 @@ jobs: - name: checkout code uses: actions/checkout@v3 - - - name: Cache Docker layers - uses: actions/cache@v3 - id: cache - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -37,5 +28,11 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build image - run: build/bin/build \ No newline at end of file + name: Build and push + uses: docker/bake-action@v2.2.0 + with: + files: build/docker-bake.hcl + push: true + set: | + *.cache-from=type=gha + *.cache-to=type=gha,mode=max \ No newline at end of file diff --git a/build/bin/build b/build/bin/build deleted file mode 100755 index da63117..0000000 --- a/build/bin/build +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -docker buildx bake --push --file build/docker-bake.hcl \ No newline at end of file