From 366f2d89282449035a95894e322c31abd1a89242 Mon Sep 17 00:00:00 2001 From: Robert Oleynik Date: Tue, 8 Jul 2025 16:10:39 +0200 Subject: [PATCH 1/3] exclude pushing Dockerimages for external PRs --- .github/workflows/build_test_deploy.yml | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 371be99d112..7ac58130fb0 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -263,44 +263,65 @@ jobs: run: docker compose --file .github/docker-compose.yml down --volumes --remove-orphans - uses: docker/login-action@v3 + if: > + github.actor != 'dependabot[bot]' && + github.event.pull_request.head.repo.full_name == github.repository with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Push webknossos image - if: ${{ ! startsWith(github.ref, 'refs/tags/') }} + if: > + ${{ ! startsWith(github.ref, 'refs/tags/') }} && + github.actor != 'dependabot[bot]' && + github.event.pull_request.head.repo.full_name == github.repository uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos:${{ env.DOCKER_TAG }}" retries: 5 retry_delay_seconds: 10 - name: Push normalized webknossos image + if: > + github.actor != 'dependabot[bot]' && + github.event.pull_request.head.repo.full_name == github.repository uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos:${{ env.NORMALIZED_BRANCH }}" retries: 5 retry_delay_seconds: 10 - name: Push webknossos-datastore image - if: ${{ ! startsWith(github.ref, 'refs/tags/') }} + if: > + ${{ ! startsWith(github.ref, 'refs/tags/') }} && + github.actor != 'dependabot[bot]' && + github.event.pull_request.head.repo.full_name == github.repository uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos-datastore:${{ env.DOCKER_TAG }}" retries: 5 retry_delay_seconds: 10 - name: Push normalized webknossos-datastore image + if: > + github.actor != 'dependabot[bot]' && + github.event.pull_request.head.repo.full_name == github.repository uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos-datastore:${{ env.NORMALIZED_BRANCH }}" retries: 5 retry_delay_seconds: 10 - name: Push webknossos-tracingstore image - if: ${{ ! startsWith(github.ref, 'refs/tags/') }} + if: > + ${{ ! startsWith(github.ref, 'refs/tags/') }} && + github.actor != 'dependabot[bot]' && + github.event.pull_request.head.repo.full_name == github.repository uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos-tracingstore:${{ env.DOCKER_TAG }}" retries: 5 retry_delay_seconds: 10 - name: Push normalized webknossos-tracingstore image + if: > + github.actor != 'dependabot[bot]' && + github.event.pull_request.head.repo.full_name == github.repository uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos-tracingstore:${{ env.NORMALIZED_BRANCH }}" From 0ff08085812b2973c32c0376dee5b3c022b4817b Mon Sep 17 00:00:00 2001 From: Robert Oleynik Date: Wed, 9 Jul 2025 09:25:39 +0200 Subject: [PATCH 2/3] improve CI step conditions --- .github/workflows/build_test_deploy.yml | 35 ++++++++++--------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 7ac58130fb0..d1d4fde4ef7 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -263,65 +263,58 @@ jobs: run: docker compose --file .github/docker-compose.yml down --volumes --remove-orphans - uses: docker/login-action@v3 - if: > - github.actor != 'dependabot[bot]' && - github.event.pull_request.head.repo.full_name == github.repository + if: ${{ github.actor != 'dependabot[bot]' && + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Push webknossos image - if: > - ${{ ! startsWith(github.ref, 'refs/tags/') }} && + if: ${{ ! startsWith(github.ref, 'refs/tags/') github.actor != 'dependabot[bot]' && - github.event.pull_request.head.repo.full_name == github.repository + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos:${{ env.DOCKER_TAG }}" retries: 5 retry_delay_seconds: 10 - name: Push normalized webknossos image - if: > - github.actor != 'dependabot[bot]' && - github.event.pull_request.head.repo.full_name == github.repository + if: ${{ github.actor != 'dependabot[bot]' && + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos:${{ env.NORMALIZED_BRANCH }}" retries: 5 retry_delay_seconds: 10 - name: Push webknossos-datastore image - if: > - ${{ ! startsWith(github.ref, 'refs/tags/') }} && + if: ${{ ! startsWith(github.ref, 'refs/tags/') && github.actor != 'dependabot[bot]' && - github.event.pull_request.head.repo.full_name == github.repository + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos-datastore:${{ env.DOCKER_TAG }}" retries: 5 retry_delay_seconds: 10 - name: Push normalized webknossos-datastore image - if: > - github.actor != 'dependabot[bot]' && - github.event.pull_request.head.repo.full_name == github.repository + if: ${{ github.actor != 'dependabot[bot]' && + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos-datastore:${{ env.NORMALIZED_BRANCH }}" retries: 5 retry_delay_seconds: 10 - name: Push webknossos-tracingstore image - if: > - ${{ ! startsWith(github.ref, 'refs/tags/') }} && + if: ${{ ! startsWith(github.ref, 'refs/tags/') && github.actor != 'dependabot[bot]' && - github.event.pull_request.head.repo.full_name == github.repository + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos-tracingstore:${{ env.DOCKER_TAG }}" retries: 5 retry_delay_seconds: 10 - name: Push normalized webknossos-tracingstore image - if: > - github.actor != 'dependabot[bot]' && - github.event.pull_request.head.repo.full_name == github.repository + if: ${{ github.actor != 'dependabot[bot]' && + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} uses: ./.github/actions/retry with: run: docker push "scalableminds/webknossos-tracingstore:${{ env.NORMALIZED_BRANCH }}" From 77ae3173497001e18736c46510062ac12781332d Mon Sep 17 00:00:00 2001 From: Robert Oleynik Date: Wed, 9 Jul 2025 09:39:32 +0200 Subject: [PATCH 3/3] add missing and --- .github/workflows/build_test_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index d1d4fde4ef7..bf891f17d64 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -270,7 +270,7 @@ jobs: password: ${{ secrets.DOCKER_PASS }} - name: Push webknossos image - if: ${{ ! startsWith(github.ref, 'refs/tags/') + if: ${{ ! startsWith(github.ref, 'refs/tags/') && github.actor != 'dependabot[bot]' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} uses: ./.github/actions/retry