diff --git a/.github/workflows/update-docs.yaml b/.github/workflows/update-docs.yaml new file mode 100644 index 00000000..3309ead6 --- /dev/null +++ b/.github/workflows/update-docs.yaml @@ -0,0 +1,39 @@ +# this workflow is used to update the Regal content at docs.styra.com +# when it changes in this repo. +name: Update Docs + +on: + push: + branches: + - main + +jobs: + update-docs: + name: Update Docs + runs-on: ubuntu-22.04 + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate GitHub App Token + id: generate_token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.PLATFORM_AUTOMATION_GH_APP_ID }} + private_key: ${{ secrets.PLATFORM_AUTOMATION_GH_APP_PEM_KEY }} + + - name: Trigger Update in docs repo + run: | + curl -X "POST" "https://api.github.com/repos/StyraInc/docs/actions/workflows/update-regal.yaml/dispatches" \ + -H 'Accept: application/vnd.github+json' \ + -H 'Authorization: Bearer ${{ steps.generate_token.outputs.token }}' \ + -H 'X-Github-Api-Version: 2022-11-28' \ + -H 'Content-Type: application/json; charset=utf-8' \ + -d '{ + "ref": "main", + "inputs": { + "version": "latest" + } + }'