@@ -740,11 +740,6 @@ jobs:
740740 image : tinybirdco/tinybird-local:latest
741741 ports :
742742 - 7181:7181
743- env :
744- TINYBIRD_HOST : ${{ secrets.TINYBIRD_HOST }}
745- TINYBIRD_TOKEN : ${{ secrets.TINYBIRD_TOKEN }}
746- TINYBIRD_HOST_STAGING : ${{ secrets.TINYBIRD_HOST_STAGING }}
747- TINYBIRD_TOKEN_STAGING : ${{ secrets.TINYBIRD_TOKEN_STAGING }}
748743 steps :
749744 - uses : actions/checkout@v6
750745 - name : Install Tinybird CLI
@@ -753,10 +748,51 @@ jobs:
753748 run : tb build
754749 - name : Test project
755750 run : tb test run
756- - name : Deployment check - Staging
757- run : tb --cloud --host ${{ env.TINYBIRD_HOST_STAGING }} --token ${{ env.TINYBIRD_TOKEN_STAGING }} deploy --check
758- - name : Deployment check - Production
759- run : tb --cloud --host ${{ env.TINYBIRD_HOST }} --token ${{ env.TINYBIRD_TOKEN }} deploy --check
751+ - name : Trigger and watch traffic analytics infra Tinybird workflow
752+ if : github.repository == 'TryGhost/Ghost'
753+ env :
754+ GH_TOKEN : ${{ secrets.CANARY_DOCKER_BUILD }}
755+ run : |
756+ set -euo pipefail
757+
758+ REPO="TryGhost/traffic-analytics-infra"
759+ WORKFLOW="tinybird.yml"
760+ BRANCH="main"
761+ DISPATCHED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
762+
763+ gh workflow run "$WORKFLOW" \
764+ --repo "$REPO" \
765+ --ref "$BRANCH" \
766+ -f ghost_ref='${{ github.ref }}' \
767+ -f run_local_tests='false'
768+
769+ RUN_ID=""
770+ RUN_URL=""
771+
772+ for attempt in {1..30}; do
773+ RUN_ID=$(gh run list \
774+ --repo "$REPO" \
775+ --workflow "$WORKFLOW" \
776+ --branch "$BRANCH" \
777+ --event workflow_dispatch \
778+ --json databaseId,createdAt,url \
779+ --jq 'map(select(.createdAt >= "'"$DISPATCHED_AT"'")) | sort_by(.createdAt) | last | .databaseId // empty')
780+
781+ if [ -n "$RUN_ID" ]; then
782+ RUN_URL=$(gh run view "$RUN_ID" --repo "$REPO" --json url --jq '.url')
783+ break
784+ fi
785+
786+ sleep 5
787+ done
788+
789+ if [ -z "$RUN_ID" ]; then
790+ echo "::error::Unable to find the triggered workflow run in $REPO"
791+ exit 1
792+ fi
793+
794+ echo "Watching remote workflow run: $RUN_URL"
795+ gh run watch "$RUN_ID" --repo "$REPO" --exit-status
760796
761797 job_ghost-cli :
762798 name : Ghost-CLI tests
0 commit comments