File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# .github/workflows/preview.yml
22name : Deploy PR previews
33permissions :
4- contents : write
4+ contents : read
55concurrency :
66 group : preview-${{ github.workflow }}-${{ github.ref }}
77 cancel-in-progress : true
1616jobs :
1717 deploy-preview :
1818 runs-on : ubuntu-latest
19- if : github.actor != 'dependabot[bot]'
19+ if : |
20+ github.actor != 'dependabot[bot]' &&
21+ github.event.pull_request.draft == false &&
22+ github.event.pull_request.head.repo.full_name == github.repository
23+ permissions :
24+ contents : write # Required for pr-preview-action to push to gh-pages
25+ pull-requests : write # Required for PR comments
2026 steps :
2127 - name : Cached LFS checkout
2228 uses : nschloe/action-cached-lfs-checkout@f46300cd8952454b9f0a21a3d133d4bd5684cfc2
3844
3945 - name : Deploy preview
4046 uses : rossjrw/pr-preview-action@9f77b1d057b494e662c50b8ca40ecc63f21e0887
47+ id : preview-step
4148 with :
4249 source-dir : ./build/
50+
51+ - name : Publish preview link to job summary
52+ if : steps['preview-step'].outputs['deployment-action'] == 'deploy'
53+ run : |
54+ url="${{ steps['preview-step'].outputs['preview-url'] }}"
55+ echo "Preview visible at ${url}" >> "$GITHUB_STEP_SUMMARY"
56+ echo "[Open preview](${url})" >> "$GITHUB_STEP_SUMMARY"
You can’t perform that action at this time.
0 commit comments