From 64ec1dff7b2ef23235f0c030c1f033a275b0c629 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Mon, 8 Jan 2024 11:51:17 +1100 Subject: [PATCH] CD.yml: Refactored conditional to the appropriate on: syntax --- .github/workflows/CD.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 351c8454..a381d8ed 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -1,11 +1,14 @@ name: CD -on: [push, pull_request] +on: + push: + tags: + - '*' jobs: conda: name: build and deploy to conda - if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.repository == 'payu-org/payu' runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job @@ -34,7 +37,7 @@ jobs: pypi-build: name: Build package for PyPI - if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.repository == 'payu-org/payu' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -54,7 +57,7 @@ jobs: # Split build and publish to restrict trusted publishing to just this workflow needs: ['pypi-build'] name: Publish to PyPI.org - if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.repository == 'payu-org/payu' runs-on: ubuntu-latest permissions: # IMPORTANT: this permission is mandatory for trusted publishing