From 5c488f8298809be8a79f4d3ab23721002182b188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Fri, 7 Jan 2022 15:52:08 +0100 Subject: [PATCH] Limit design site builds (#11120) --- .github/workflows/netflify.yml | 4 ++-- gallery/script/netlify_build_gallery | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/netflify.yml b/.github/workflows/netflify.yml index 47f13fef80..51989057ba 100644 --- a/.github/workflows/netflify.yml +++ b/.github/workflows/netflify.yml @@ -15,5 +15,5 @@ jobs: - name: Trigger Demo build run: curl -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.NETLIFY_DEMO_DEV_BUILD_HOOK }} - - name: Trigger Gallery build - run: curl -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.NETLIFY_GALLERY_DEV_BUILD_HOOK }} + - name: Trigger Design build + run: curl -X POST -d "NIGHTLY" https://api.netlify.com/build_hooks/${{ secrets.NETLIFY_GALLERY_DEV_BUILD_HOOK }} diff --git a/gallery/script/netlify_build_gallery b/gallery/script/netlify_build_gallery index 295486a2b1..4bbad59e25 100755 --- a/gallery/script/netlify_build_gallery +++ b/gallery/script/netlify_build_gallery @@ -17,9 +17,7 @@ function createStatus() { } -if [[ "${PULL_REQUEST}" == "false" ]]; then - gulp build-gallery -else +if [[ "${PULL_REQUEST}" == "true" ]]; then if [[ "$(curl -sSLf -H "Accept: application/vnd.github.v3+json" -H "Authorization: token $GITHUB_TOKEN" \ "https://api.github.com/repos/home-assistant/frontend/pulls/${REVIEW_ID}" | jq '.labels[].name' -r)" =~ "$TARGET_LABEL" ]]; then createStatus "pending" "Building design preview" "https://app.netlify.com/sites/home-assistant-gallery/deploys/$BUILD_ID" @@ -32,4 +30,6 @@ else else createStatus "success" "Build was not requested by PR label" fi +elif [[ "${$INCOMING_HOOK_BODY}" == "NIGHTLY" ]]; then + gulp build-gallery fi