Skip to content

Commit 5d5167b

Browse files
committed
Action: Add workflow for automated preview deployments on latest
1 parent 8244882 commit 5d5167b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/previews.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: exampleSite preview
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Trigger `Build and deploy` workflow in `documentation` repo
13+
run: |
14+
repo_owner="nginx"
15+
repo_name="documentation"
16+
event_type="trigger-preview-build"
17+
environment="preview"
18+
theme_version=""
19+
20+
curl -L \
21+
-X POST \
22+
-H "Accept: application/vnd.github+json" \
23+
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
24+
-H "X-GitHub-Api-Version: 2022-11-28" \
25+
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
26+
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"environment\": \"$environment\", \"hugo_theme_override\": \"$theme_version\"}}"

0 commit comments

Comments
 (0)