Skip to content

Commit a49eba3

Browse files
committed
Action: Added preview to exampleSite
1 parent 70798f3 commit a49eba3

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/build-push.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build preview
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
env:
12+
REPO_OWNER: "nginx"
13+
REPO_NAME: "documentation"
14+
15+
jobs:
16+
deploy-example-site:
17+
uses: nginxinc/docs-actions/.github/workflows/docs-build-push.yml@9c59fab05a8131f4d691ba6ea2b6a119f3ef832a # v1.0.7
18+
with:
19+
production_url_path: "/nginx-hugo-theme"
20+
preview_url_path: "/previews/nginx-hugo-theme"
21+
docs_source_path: "./exampleSite/public"
22+
docs_build_path: "./exampleSite"
23+
doc_type: "hugo"
24+
environment: "preview"
25+
force_hugo_theme_version: ""
26+
auto_deploy_branch: "main"
27+
auto_deploy_env: "prod"
28+
secrets:
29+
AZURE_CREDENTIALS: ${{secrets.AZURE_CREDENTIALS_DOCS}}
30+
AZURE_KEY_VAULT: ${{secrets.AZURE_KEY_VAULT_DOCS}}
31+
32+
# deploy-documentation-site:
33+
# runs-on: ubuntu-latest
34+
# steps:
35+
# - name: Trigger `Build and deploy` workflow in `documentation` repo
36+
# run: |
37+
# event_type="trigger-preview-build"
38+
# environment="preview"
39+
# 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
40+
41+
# curl -L \
42+
# -X POST \
43+
# -H "Accept: application/vnd.github+json" \
44+
# -H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
45+
# -H "X-GitHub-Api-Version: 2022-11-28" \
46+
# "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/dispatches" \
47+
# -d "{\"event_type\": \"$event_type\", \"client_payload\": {\"environment\": \"$environment\", \"hugo_theme_override\": \"$theme_version\"}}"
48+
49+
# - name: Get the most recent workflow id
50+
# run: |
51+
# pipeline_id=$(curl -L \
52+
# -H "Accept: application/vnd.github+json" \
53+
# -H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
54+
# -H "X-GitHub-Api-Version: 2022-11-28" \
55+
# "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/actions/runs?event=repository_dispatch" | \
56+
# jq '.workflow_runs[0].id')
57+
58+
# Get the commented URL
59+
# Show a comment on the workflow for the URL

0 commit comments

Comments
 (0)