@@ -4,9 +4,8 @@ This guide will help you set up docs previews for your GitHub repository.
44
55## GitHub Workflows
66
7- The docs preview system consists of three GitHub Workflows:
7+ The docs preview system consists of two GitHub Workflows:
88- [ ` docs-build.yml ` ] ( #build ) : ** Build** the docs on a PR
9- - [ ` docs-deploy.yml ` ] ( #deploy ) : ** Deploy** the docs to our preview environment
109- [ ` docs-cleanup.yml ` ] ( #cleanup ) : ** Cleanup** the docs after a PR is merged or closed
1110
1211
@@ -22,65 +21,31 @@ This way you only build and deploy the docs when there are changes to the docs a
2221
2322``` yaml
2423---
25- name : docs-build <1>
24+ name : docs-build
2625
2726on :
28- push : <2>
27+ push :
2928 branches :
3029 - main
31- pull_request : ~
30+ pull_request_target : ~
3231
3332jobs :
3433 docs-preview :
35- uses : elastic/docs-builder/.github/workflows/preview-build.yml <3 >
34+ uses : elastic/docs-builder/.github/workflows/preview-build.yml <2 >
3635 with :
37- path-pattern : docs/** <4 >
36+ path-pattern : docs/** <3 >
3837 permissions :
38+ id-token : write
39+ deployments : write
3940 contents : read
4041 pull-requests : read
4142` ` `
4243
43- 1. The naming is important so that the ` docs-deploy` workflow is triggered.
44- 2. You can omit the `push` event if you only want to build the docs on PRs.
45- 3. Reusable workflow : [elastic/docs-builder/.github/workflows/preview-build.yml](https://github.com/elastic/docs-builder/blob/main/.github/workflows/preview-build.yml)
46- 4. This should be the path to your docs folder.
47-
44+ 1. Reusable workflow: [elastic/docs-builder/.github/workflows/preview-build.yml](https://github.com/elastic/docs-builder/blob/main/.github/workflows/preview-build.yml)
45+ 2. This should be the path to your docs folder.
4846
4947::::
5048
51- # ## Deploy
52-
53- This workflow is triggered when the `docs-build` workflow is completed. The underlying reusable workflow, downloads the artifact and deploys the docs to our preview environment.
54-
55-
56- ::::{dropdown} .github/workflows/docs-deploy.yml
57- :open :
58-
59- ` ` ` yaml
60- ---
61- name: docs-deploy
62-
63- on:
64- workflow_run:
65- workflows:
66- - docs-build <1>
67- types:
68- - completed
69-
70- jobs:
71- docs-preview:
72- uses: elastic/docs-builder/.github/workflows/preview-deploy.yml <2>
73- permissions:
74- contents: none <3>
75- id-token: write
76- deployments: write
77- actions: read
78- ` ` `
79- 1. The name of the previously mentioned `docs-build` workflow.
80- 2. Reusable workflow : [elastic/docs-builder/.github/workflows/preview-deploy.yml](https://github.com/elastic/docs-builder/blob/main/.github/workflows/preview-deploy.yml)
81- 3. No need to read the code.
82-
83- ::: :
8449
8550### Cleanup
8651
0 commit comments