From 37f7da95f5a7e17377749a810f3f04c7fcbe3cfb Mon Sep 17 00:00:00 2001 From: Dmitry Smirnov Date: Wed, 23 Oct 2024 12:00:52 +0300 Subject: [PATCH 1/2] improved release pipeline to prevent building twice --- .github/workflows/release.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 655f1546..de04c612 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,6 +49,7 @@ jobs: configFilePath: ci/git-version.yml - name: Multi-arch build + id: build uses: docker/build-push-action@v6 with: context: . @@ -56,11 +57,9 @@ jobs: platforms: linux/amd64,linux/arm64 push: false cache-from: type=inline - cache-to: type=inline + cache-to: type=inline,mode=max tags: | usabilitydynamics/udx-worker:${{ steps.gitversion.outputs.semVer }} - build-args: | - GIT_VERSION=${{ steps.gitversion.outputs.semVer }} - name: Generate changelog id: changelog @@ -127,15 +126,14 @@ jobs: username: ${{ vars.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - - name: Release the image + - name: Push Docker image uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true - cache-from: type=inline - cache-to: type=inline + cache-from: type=inline,mode=max tags: | usabilitydynamics/udx-worker:${{ needs.test-pipeline.outputs.semVer }} usabilitydynamics/udx-worker:latest From 492be4f6aa0fcf3b67a2f93af40018829b54a15b Mon Sep 17 00:00:00 2001 From: Dmitry Smirnov Date: Wed, 23 Oct 2024 12:06:19 +0300 Subject: [PATCH 2/2] migrate github-release to softprops/action-gh-release --- .github/workflows/release.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de04c612..220eaf01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: driver: docker-container - name: Prepare Docker cache directory - run: mkdir -p /tmp/.buildx-cache + run: mkdir -p /tmp/.buildx-cache - name: Cache Docker layers uses: actions/cache@v4 @@ -34,7 +34,7 @@ jobs: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} restore-keys: | - ${{ runner.os }}-buildx- + ${{ runner.os }}-buildx- - name: Install GitVersion uses: gittools/actions/gitversion/setup@v2 @@ -94,10 +94,9 @@ jobs: git push origin ${{ needs.test-pipeline.outputs.semVer }} - name: Create GitHub release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v2 with: tag_name: ${{ needs.test-pipeline.outputs.semVer }} - release_name: ${{ needs.test-pipeline.outputs.semVer }} body: ${{ needs.test-pipeline.outputs.changelog }} draft: false prerelease: false