From 675f2afff280f6adf3953066dfafd69c83e1cd9e Mon Sep 17 00:00:00 2001 From: Hassan Kibirige Date: Thu, 29 Feb 2024 22:37:35 +0300 Subject: [PATCH] GHA: Push to main triggers building the website --- .github/workflows/build_website.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build_website.yml diff --git a/.github/workflows/build_website.yml b/.github/workflows/build_website.yml new file mode 100644 index 0000000..1d269f6 --- /dev/null +++ b/.github/workflows/build_website.yml @@ -0,0 +1,28 @@ +# Ref: https://medium.com/hostspaceng/triggering-workflows-in-another-repository-with-github-actions-4f581f8e0ceb +# https://docs.github.com/en/rest/about-the-rest-api/api-versions +name: Build WebsiteTrigger Target Workflow + +on: + push: + branches: + - main + +jobs: + trigger: + runs-on: ubuntu-latest + + steps: + - name: Trigger Building plotnine.org + run: | + # Set the required variables + repo_owner="has2k1" + repo_name="plotnine.org" + event_type="trigger-workflow" + + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.BUILD_PLOTNINE_WEBSITE }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/$repo_owner/$repo_name/dispatches \ + -d "{\"event_type\": \"$event_type\", \"client_payload\": {\"unit\": false, \"integration\": true}}"