Skip to content

Slack notifications for theme releases #10

Slack notifications for theme releases

Slack notifications for theme releases #10

Workflow file for this run

name: documentation preview
on:
release:
types:
- published
pull_request:
branches:
- "*"
jobs:
build-example:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Build the exampleSite docs
uses: ./.github/workflows/hugo-build-test
build-documentation:
runs-on: ubuntu-latest
steps:
- name: Trigger 'Build and deploy' workflow in 'documentation' repo
run: |
repo_owner="nginx"
repo_name="documentation"
event_type="trigger-preview-build"
environment="preview"
theme_version="${{ github.head_ref || '' }}" # Will either be the branch name if triggered from pull request, or empty string (aka latest) if triggered from release
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-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\": {\"environment\": \"$environment\", \"hugo_theme_override\": \"$theme_version\"}}"