From e86d2f2a003058a46eabe49244749f164f40dbe2 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 11 Aug 2023 00:20:51 +0200 Subject: [PATCH 1/2] ci(ct): fix not pushing feature branches to Docker Hub #9769 By ensuring pushes to Docker Hub are only executed when based on develop or master branch, we avoid breaking the images on the Hub: simply skip the deploy job on wrong pushed to branch. --- .github/workflows/container_app_push.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/container_app_push.yml b/.github/workflows/container_app_push.yml index c60691b1c85..cc9d9926e61 100644 --- a/.github/workflows/container_app_push.yml +++ b/.github/workflows/container_app_push.yml @@ -99,8 +99,12 @@ jobs: name: "Package & Publish" runs-on: ubuntu-latest # Only run this job if we have access to secrets. This is true for events like push/schedule which run in - # context of main repo, but for PRs only true if coming from the main repo! Forks have no secret access. - if: needs.check-secrets.outputs.available == 'true' + # context of the main repo, but for PRs only true if coming from the main repo! Forks have no secret access. + # + # Note: The team's decision was to not auto-deploy an image on any git push where no PR exists (yet). + # Accordingly, only run for push events on branches develop and master. + if: needs.check-secrets.outputs.available == 'true' && + ( github.event_name != 'push' || ( github.event_name == 'push' && contains(fromJSON('["develop", "master"]'), github.ref_name))) steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 @@ -109,7 +113,7 @@ jobs: distribution: temurin # Depending on context, we push to different targets. Login accordingly. - - if: ${{ github.event_name != 'pull_request' }} + - if: github.event_name != 'pull_request' name: Log in to Docker Hub registry uses: docker/login-action@v2 with: From b8e116ad39b88e888c6e13cae7dfb0318056598c Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 11 Aug 2023 00:22:28 +0200 Subject: [PATCH 2/2] ci(spi): fix typos in GH action to run only on selected branches --- .github/workflows/spi_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spi_release.yml b/.github/workflows/spi_release.yml index 1fbf05ce693..0d584693ccf 100644 --- a/.github/workflows/spi_release.yml +++ b/.github/workflows/spi_release.yml @@ -2,12 +2,12 @@ name: Dataverse SPI on: push: - branch: + branches: - "develop" paths: - "modules/dataverse-spi/**" pull_request: - branch: + branches: - "develop" paths: - "modules/dataverse-spi/**"