From ed7582e617509637f49534e9fc84704df058dd09 Mon Sep 17 00:00:00 2001 From: Daniel Kelemen Date: Mon, 16 Oct 2023 16:04:21 +0200 Subject: [PATCH] - add platforms to buildx setup - revert buildx cache --- .../workflows/build-test-and-publish-ce.yml | 18 ++++++++++++++++++ release.sh | 2 ++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/build-test-and-publish-ce.yml b/.github/workflows/build-test-and-publish-ce.yml index 9680be89..2876c1d5 100644 --- a/.github/workflows/build-test-and-publish-ce.yml +++ b/.github/workflows/build-test-and-publish-ce.yml @@ -11,6 +11,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + if: ${{ matrix.PLATFORM == 'aws-arm-core-2-default' }} + with: + username: ${{ env.DOCKER_HUB_USERNAME }} + password: ${{ env.DOCKER_HUB_PASSWORD }} - name: Build run: ./pipeline.sh env: @@ -36,6 +42,18 @@ jobs: uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + with: + platforms: linux/arm64,linux/amd64 + - name: Expose GitHub Runtime + uses: actions/github-script@v6 + with: + script: | + Object.keys(process.env).forEach(function (key) { + if (key.startsWith('ACTIONS_')) { + core.info(`${key}=${process.env[key]}`); + core.exportVariable(key, process.env[key]); + } + }); - name: Publish multi-platform images run: ./release.sh env: diff --git a/release.sh b/release.sh index e5bbbea2..b2a008c8 100755 --- a/release.sh +++ b/release.sh @@ -20,6 +20,8 @@ function build_and_push { --build-arg EE=${EE} \ --build-arg USER=${NEXUS_USER} \ --build-arg PASSWORD=${NEXUS_PASS} \ + --cache-to type=gha,scope="$GITHUB_REF_NAME-$DISTRO-image" \ + --cache-from type=gha,scope="$GITHUB_REF_NAME-$DISTRO-image" \ --platform $PLATFORMS echo "::endgroup::"