Skip to content

Commit dab07c8

Browse files
Add /demo/ to commented deploy URL (#86)
1 parent 3165ddb commit dab07c8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/pr-preview.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414

1515
concurrency: preview-${{ github.ref }}
1616

17+
env:
18+
PREVIEW_BRANCH: gh-pages
1719
jobs:
1820
deploy-preview:
1921
runs-on: ubuntu-latest
@@ -30,6 +32,29 @@ jobs:
3032
# Reference: https://github.com/rossjrw/pr-preview-action
3133
- name: Deploy preview
3234
uses: rossjrw/pr-preview-action@v1
35+
id: preview-step
3336
with:
3437
source-dir: ./ghpages/
3538
umbrella-dir: pr
39+
preview-branch: ${{ env.PREVIEW_BRANCH }}
40+
comment: false
41+
42+
- uses: marocchino/sticky-pull-request-comment@v2
43+
if: steps.preview-step.outputs.deployment-action == 'deploy'
44+
with:
45+
header: pr-preview
46+
message: |
47+
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) ${{ steps.preview-step.outputs.action-version }}
48+
:---:
49+
| <p></p> :rocket: View preview at <br> ${{ steps.preview-step.outputs.preview-url }}demo/ <br><br>
50+
| <h6>Built to branch [`${{ env.PREVIEW_BRANCH }}`](${{ github.server_url }}/${{ github.repository }}/tree/${{ env.PREVIEW_BRANCH }}) at ${{ steps.preview-step.outputs.action-start-time }}. <br> Preview will be ready when the [GitHub Pages deployment](${{ github.server_url }}/${{ github.repository }}/deployments) is complete. <br><br> </h6>
51+
52+
- uses: marocchino/sticky-pull-request-comment@v2
53+
if: steps.preview-step.outputs.deployment-action == 'remove'
54+
with:
55+
header: pr-preview
56+
message: |
57+
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) ${{ steps.preview-step.outputs.action-version }}
58+
:---:
59+
Preview removed because the pull request was closed.
60+
${{ steps.preview-step.outputs.action-start-time }}

0 commit comments

Comments
 (0)