diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 709c4328cd..62a8cbdc39 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -44,3 +44,17 @@ jobs: CI: true TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres + + trigger-ci-build: + runs-on: ubuntu-latest + needs: [build] + if: github.event.commits && github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v2 + - name: Trigger CI build + env: + UNLEASH_CI_BUILDER_GITHUB_TOKEN: ${{ secrets.UNLEASH_CI_BUILDER_GITHUB_TOKEN }} + run: | + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${UNLEASH_CI_BUILDER_GITHUB_TOKEN}" \ + https://api.github.com/repos/bricks-software/unleash-ci-builder/dispatches \ + -d '{"event_type":"trigger-unleash-cloud-build","client_payload":{"commits":${{toJSON(github.event.commits)}}}}'