From da068165f6c8ae5771abb6aaf1523accef8e250d Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 14 Mar 2022 06:33:50 +0100 Subject: [PATCH] ci: simple gha workflow to build docker daemon Signed-off-by: CrazyMax --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ docker-bake.hcl | 24 +++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 docker-bake.hcl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..35fb373e63 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: ci + +on: + workflow_dispatch: + push: + branches: + - 'master' + - '[0-9]+.[0-9]{2}' + tags: + - 'v*' + pull_request: + +env: + BUNDLES_OUTPUT: ./bundles + +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + target: + - binary + - dynbinary + steps: + - + name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Build + uses: docker/bake-action@v1 + with: + targets: ${{ matrix.target }} + - + name: Upload build artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.target }} + path: ${{ env.BUNDLES_OUTPUT }}/${{ matrix.target }}-daemon/* + if-no-files-found: error diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 0000000000..a560a2d26f --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,24 @@ +variable "BUNDLES_OUTPUT" { + default = "./bundles" +} + +target "_common" { + args = { + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } +} + +group "default" { + targets = ["binary"] +} + +target "binary" { + inherits = ["_common"] + target = "binary" + output = [BUNDLES_OUTPUT] +} + +target "dynbinary" { + inherits = ["binary"] + target = "dynbinary" +}