From 7e811ff549437a8eb29b6cc52e677d5373d42e73 Mon Sep 17 00:00:00 2001 From: ollie-bell <56110893+ollie-bell@users.noreply.github.com> Date: Mon, 23 Sep 2024 00:07:37 +0100 Subject: [PATCH] [ENG-1744] tz-solve build trigger (#149) --- .github/workflows/trigger-tz-solve-build.yml | 38 +++++++++++++++++++ .../tz-solve-osemosys-build-webhook.yml | 18 --------- 2 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/trigger-tz-solve-build.yml delete mode 100644 .github/workflows/tz-solve-osemosys-build-webhook.yml diff --git a/.github/workflows/trigger-tz-solve-build.yml b/.github/workflows/trigger-tz-solve-build.yml new file mode 100644 index 00000000..ae13f1a8 --- /dev/null +++ b/.github/workflows/trigger-tz-solve-build.yml @@ -0,0 +1,38 @@ +name: tz-solve build trigger + +on: + push: + branches: + - main + - staging + paths: + - tz/osemosys/** + - pyproject.toml + - .github/workflows/trigger-tz-solve-build.yml + release: + types: [published] + +jobs: + trigger-tz-solve-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - id: auth + uses: google-github-actions/auth@v2 + with: + credentials_json: ${{ secrets.TZ_SOLVE_SERVICE_ACCOUNT_KEY }} + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v2 + with: + version: latest + + - name: Trigger tz-solve build + run: | + gcloud builds triggers run tz-solve-build \ + --region=europe-west2 \ + --branch=main \ + --substitutions=_REF=${{ github.ref_name }} diff --git a/.github/workflows/tz-solve-osemosys-build-webhook.yml b/.github/workflows/tz-solve-osemosys-build-webhook.yml deleted file mode 100644 index 46f64263..00000000 --- a/.github/workflows/tz-solve-osemosys-build-webhook.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: tz-solve build webhook - -on: - push: - branches: - - main - paths: - - 'tz/osemosys/**' - - 'pyproject.toml' - - '.github/workflows/tz-solve-osemosys-build-webhook.yml' - -jobs: - trigger-webhook: - runs-on: ubuntu-latest - steps: - - name: Trigger webhook - run: | - curl -X POST -H "Content-Type: application/json" -d "{}" "${{ secrets.TZ_SOLVE_OSEMOSYS_BUILD_WEBHOOK }}"