From 16f023a397c2ea16c870d25524b5bfd5e623b40b Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Fri, 13 Sep 2024 15:24:03 -0400 Subject: [PATCH] fix(ci): only deploy maps app previews on relevant pull requests --- .github/workflows/deploy-apps-maps.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-apps-maps.yml b/.github/workflows/deploy-apps-maps.yml index 6ea19913d6..b89dbd8f07 100644 --- a/.github/workflows/deploy-apps-maps.yml +++ b/.github/workflows/deploy-apps-maps.yml @@ -2,10 +2,14 @@ name: Build and publish apps/maps on: push: + branches: + - 'main' paths: + - '.github/workflows/deploy-apps-maps.yml' - 'apps/maps/**' pull_request: paths: + - '.github/workflows/deploy-apps-maps.yml' - 'apps/maps/**' workflow_dispatch: @@ -34,7 +38,7 @@ jobs: # Preview on PRs - name: Deploy apps/maps preview to Netlify - if: ${{ github.ref != 'refs/heads/main' }} + if: ${{ github.event_name == 'pull_request' }} run: | npm install -g netlify-cli netlify deploy --site=embeddable-maps-calitp-org --dir=apps/maps/build --alias=${GITHUB_REPOSITORY#*/}-${PR_NUMBER}