From e1adffa72bbacd2721277c7751e6713de18f6702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Tue, 21 Nov 2023 19:26:40 +0100 Subject: [PATCH] fix(cicd): broken tag extraction --- .gitea/workflows/build.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index fcb635a..cd874c7 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -3,6 +3,9 @@ name: Build on: schedule: - cron: "0 0 * * 1" + push: + tags: + - 'manual_build' jobs: build: @@ -15,30 +18,38 @@ jobs: run: | git clone https://github.com/ONLYOFFICE/DocumentServer cd DocumentServer - echo "docker_tag=$(git describe --tags --abbrev=0 | cut -d 'v' -f2-") >> GITHUB_OUTPUT + echo "docker_tag=$(git describe --tags --abbrev=0 | cut -d 'v' -f2-)" >> GITHUB_OUTPUT + docker_tag=$(git describe --tags --abbrev=0 | cut -d 'v' -f2-) + echo $docker_tag + if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/$(docker_tag)" > /dev/null; then exit 1; fi cd .. && rm -rf DocumentServer shell: bash - name: Install Docker + if: steps.extract-version.conclusion == 'success' run: | apt-get update apt-get install docker.io -y - name: Login to DockerHub + if: steps.extract-version.conclusion == 'success' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up QEMU + if: steps.extract-version.conclusion == 'success' uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx + if: steps.extract-version.conclusion == 'success' uses: docker/setup-buildx-action@v1 with: # driver-opts: network=host platforms: linux/amd64,linux/arm64 - name: Build and push image + if: steps.extract-version.conclusion == 'success' uses: docker/build-push-action@v2 with: push: true @@ -46,3 +57,11 @@ jobs: platforms: linux/amd64,linux/arm64 context: . file: ./Dockerfile + + - name: Image already built + id: image-built + if: steps.extract-version.conclusion == 'failure' + run: | + echo "Image was already built and uploaded" + exit 0 + shell: bash