Skip to content

Commit

Permalink
ci: add dispatch workflow to update docs website
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Zipitria <[email protected]>
  • Loading branch information
fzipi committed Mar 25, 2024
1 parent bb55b68 commit 098da47
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Trigger documentation rebuild

on:
# Runs on pushes targeting the default branch
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
dispatch:
runs-on: ubuntu-latest
permissions:
contents: write # needed for triggering dispatch
id-token: write
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "coraza,coraza.io"

- name: Dispatch to workflows
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--data '{"event_type": "documentation", "client_payload": { "updated": true}}' \
"https://api.github.com/repos/$GITHUB_REPOSITORY_OWNER/coraza.io/dispatches"

0 comments on commit 098da47

Please sign in to comment.