Slack notifications for theme releases #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: documentation preview | |
| on: | |
| release: | |
| types: | |
| - published | |
| pull_request: | |
| branches: | |
| - "*" | |
| jobs: | |
| build-example: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - 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\"}}" |