Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ci: add dispatch workflow to update docs website #1024

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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/checkout@v4
- 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": { "sha": "${{ github.sha }}"}}' \
"https://api.github.com/repos/$GITHUB_REPOSITORY_OWNER/coraza.io/dispatches"
Loading