File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and check
2+
13on :
24 pull_request :
35
46permissions :
57 contents : read
68
9+ concurrency :
10+ group : ' build-doc-${{ github.ref }}' # This ensures concurrency for the same branch or PR
11+ cancel-in-progress : true # This cancels any in-progress execution when a new commit is done on the same branch
12+
713jobs :
814 build-doc :
915 name : Build documentation
1723 run : yarn install --frozen-lockfile
1824 - name : Build documentation website
1925 # Check URLs are valid, path to images, etc.
20- run : cd docs && yarn build
26+ run : yarn build
Original file line number Diff line number Diff line change 1+ name : Deploy
2+
13on :
24 push :
35 branches :
3436 # The GH actions bot is used by default if you didn't specify the two fields.
3537 # You can swap them out with your own user credentials.
3638 user_name : github-actions[bot]
37- user_email : 41898282+github-actions[bot]@users.noreply.github.com
39+ user_email : 41898282+github-actions[bot]@users.noreply.github.com
Original file line number Diff line number Diff line change 1+ # When a PR get labelled "preview", deploy a web rendering of the changes via pushpreview
2+ name : PushPreview
3+
4+ on :
5+ pull_request_target :
6+ types :
7+ - labeled
8+
9+ jobs :
10+ preview :
11+ runs-on : ubuntu-24.04
12+ if : github.event.label.name == 'preview'
13+ steps :
14+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+ - name : Comment
16+ run : |
17+ gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."
18+ env :
19+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20+
21+ - uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
22+ with :
23+ node-version : 18
24+
25+ - name : Set BASE_URL
26+ run : echo "BASE_URL=/github/${{ github.repository }}/${{ github.event.number }}/" >> $GITHUB_ENV
27+
28+ - name : Build site
29+ run : |
30+ yarn install --frozen-lockfile
31+ yarn build
32+
33+ - name : Generate preview
34+ uses : TechDocsStudio/pushpreview-action@cf958f7be2bf55d3f56d351bb9abf56b4c6b9a50 # 1.0.6
35+ with :
36+ source-directory : ./build
37+ github-token : ${{ secrets.GITHUB_TOKEN }}
38+ pushpreview-token : ${{ secrets.PUSHPREVIEW_TOKEN }}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const config: Config = {
1313 url : 'https://nspanelmanager.com' ,
1414 // Set the /<baseUrl>/ pathname under which your site is served
1515 // For GitHub pages deployment, it is often '/<projectName>/'
16- baseUrl : '/' ,
16+ baseUrl : process . env . BASE_URL || '/' ,
1717
1818 // GitHub pages deployment config.
1919 // If you aren't using GitHub pages, you don't need these.
You can’t perform that action at this time.
0 commit comments