@@ -95,7 +95,7 @@ parameter:
95
95
96
96
` ` ` yml
97
97
# .github/workflows/build-deploy-pages-site.yml
98
- - steps:
98
+ steps:
99
99
...
100
100
- uses: JamesIves/github-pages-deploy-action@v4
101
101
...
@@ -190,6 +190,22 @@ jobs:
190
190
action: auto
191
191
` ` `
192
192
193
+ # ## Deployment from `docs/`
194
+
195
+ If your Pages site is built to `build/` and deployed from the `docs/`
196
+ directory on the `main` branch :
197
+
198
+ ` ` ` yml
199
+ # .github/workflows/preview.yml
200
+ steps:
201
+ ...
202
+ - uses: rossjrw/pr-preview-action@v1
203
+ with:
204
+ source-dir: build
205
+ preview-branch: main
206
+ umbrella-dir: docs/pr-preview
207
+ ` ` `
208
+
193
209
# ## Only remove previews for unmerged PRs
194
210
195
211
Information from the context and conditionals can be used to make more
@@ -198,31 +214,18 @@ only those associated with _unmerged_ PRs when they are closed:
198
214
199
215
` ` ` yml
200
216
# .github/workflows/preview.yml
201
- name: Deploy PR previews; removed closed unmerged PR previews
202
- concurrency: preview-${{ github.ref }}
203
- on:
204
- pull_request:
205
- types:
206
- - opened
207
- - reopened
208
- - synchronize
209
- - closed
210
- jobs:
211
- deploy-preview:
212
- runs-on: ubuntu-20.04
213
- steps:
214
- - uses: actions/checkout@v2
215
- - run: npm i && npm run build
216
- - uses: rossjrw/pr-preview-action@v1
217
- if: contains(['opened', 'reopened', 'synchronize'], github.event.action)
218
- with:
219
- source-dir: ./build/
220
- action: deploy
221
- - uses: rossjrw/pr-preview-action@v1
222
- if: github.event.action == "closed" && !github.event.pull_request.merged
223
- with:
224
- source-dir: ./build/
225
- action: remove
217
+ steps:
218
+ ...
219
+ - uses: rossjrw/pr-preview-action@v1
220
+ if: contains(['opened', 'reopened', 'synchronize'], github.event.action)
221
+ with:
222
+ source-dir: ./build/
223
+ action: deploy
224
+ - uses: rossjrw/pr-preview-action@v1
225
+ if: github.event.action == "closed" && !github.event.pull_request.merged
226
+ with:
227
+ source-dir: ./build/
228
+ action: remove
226
229
` ` `
227
230
228
231
# ## Permanent previews
0 commit comments