From c8b318b3156fdf57e7482a05328eb5ed777881c0 Mon Sep 17 00:00:00 2001 From: Julien Neuhart Date: Sat, 28 Oct 2023 17:55:22 +0200 Subject: [PATCH] feat: add a new edge release --- .github/workflows/continuous_delivery.yml | 11 +++++++-- scripts/release.sh | 27 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous_delivery.yml b/.github/workflows/continuous_delivery.yml index 38b30bb2..97993824 100644 --- a/.github/workflows/continuous_delivery.yml +++ b/.github/workflows/continuous_delivery.yml @@ -3,9 +3,11 @@ name: Continuous Delivery on: release: types: [ published ] + push: + branches: + - main jobs: - release: name: Release Docker image runs-on: ubuntu-latest @@ -21,7 +23,12 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push Docker image + - name: Build and push Docker image for release + if: github.event_name == 'release' run: | make release GOTENBERG_VERSION=${{ github.event.release.tag_name }} make release GOTENBERG_VERSION=${{ github.event.release.tag_name }} DOCKER_REPOSITORY=thecodingmachine + - name: Build and push Docker image for main branch + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + make release GOTENBERG_VERSION=edge diff --git a/scripts/release.sh b/scripts/release.sh index 26b94b3f..f3c77ed5 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -10,6 +10,33 @@ NOTO_COLOR_EMOJI_VERSION="$5" PDFTK_VERSION="$6" DOCKER_REPOSITORY="$7" +if [ $GOTENBERG_VERSION == "edge" ]; then + docker buildx build \ + --build-arg GOLANG_VERSION="$GOLANG_VERSION" \ + --build-arg GOTENBERG_VERSION="$GOTENBERG_VERSION" \ + --build-arg GOTENBERG_USER_GID="$GOTENBERG_USER_GID" \ + --build-arg GOTENBERG_USER_UID="$GOTENBERG_USER_UID" \ + --build-arg NOTO_COLOR_EMOJI_VERSION="$NOTO_COLOR_EMOJI_VERSION" \ + --build-arg PDFTK_VERSION="$PDFTK_VERSION" \ + --platform linux/amd64 \ + --platform linux/arm64 \ + --platform linux/arm/v7 \ + --platform linux/386 \ + -t "$DOCKER_REPOSITORY/gotenberg:edge" \ + --push \ + -f build/Dockerfile . + + # Cloud Run variant. + # Only linux/amd64! See https://github.com/gotenberg/gotenberg/issues/505#issuecomment-1264679278. + docker buildx build \ + --build-arg DOCKER_REPOSITORY="$DOCKER_REPOSITORY" \ + --build-arg GOTENBERG_VERSION="$GOTENBERG_VERSION" \ + --platform linux/amd64 \ + -t "$DOCKER_REPOSITORY/gotenberg:edge-cloudrun" \ + --push \ + -f build/Dockerfile.cloudrun . +fi + GOTENBERG_VERSION="${GOTENBERG_VERSION//v}" SEMVER=( ${GOTENBERG_VERSION//./ } ) VERSION_LENGTH=${#SEMVER[@]}