From 5b88097aba83790f59ded32c52d527cc56fcb41d Mon Sep 17 00:00:00 2001 From: Fangyin Cheng Date: Fri, 3 Jan 2025 20:09:06 +0800 Subject: [PATCH] fix(ci): Fix push document image error (#2273) --- .github/workflows/doc-image-publish.yml | 20 ++++++++++++++++---- .github/workflows/pylint.yml | 2 +- .github/workflows/test-python.yml | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/doc-image-publish.yml b/.github/workflows/doc-image-publish.yml index a1df2b195..a2cab654d 100644 --- a/.github/workflows/doc-image-publish.yml +++ b/.github/workflows/doc-image-publish.yml @@ -6,9 +6,11 @@ on: - main paths: - 'docs/**' + - '.github/workflows/docker-image-publish.yml' pull_request: paths: - 'docs/**' + - '.github/workflows/docker-image-publish.yml' release: types: [published] workflow_dispatch: @@ -36,12 +38,22 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push + # Only run when there is a PR + - name: Build PR + if: github.event_name == 'pull_request' uses: docker/build-push-action@v4 with: context: . file: ./docs/Dockerfile-deploy platforms: linux/amd64 - # Only push when not in PR - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ github.event_name != 'pull_request' && 'eosphorosai/dbgpt-docs:${{ github.ref_name }},eosphorosai/dbgpt-docs:latest' || '' }} \ No newline at end of file + push: false + # Only run when it is not a PR, build and push the image + - name: Build and push + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + context: . + file: ./docs/Dockerfile-deploy + platforms: linux/amd64 + push: true + tags: eosphorosai/dbgpt-docs:${{ github.ref_name }},eosphorosai/dbgpt-docs:latest \ No newline at end of file diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index aca3bc806..801c03e4f 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -9,7 +9,7 @@ on: concurrency: group: ${{ github.event.number || github.run_id }} - cancel-in-progress: true + cancel-in-progress: false jobs: build: diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 43b34179e..ffc1bab75 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -18,7 +18,7 @@ on: concurrency: group: ${{ github.event.number || github.run_id }} - cancel-in-progress: true + cancel-in-progress: false #permissions: # contents: read