File tree 1 file changed +20
-4
lines changed
1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 14
14
# limitations under the License.
15
15
# #
16
16
17
- name : GitHub pages
17
+ name : Publish JsDoc
18
18
19
19
on :
20
20
push :
25
25
jobs :
26
26
deploy :
27
27
runs-on : ubuntu-latest
28
+ env :
29
+ PR_PATH : pull/${{github.event.number}}
28
30
permissions :
29
31
contents : write
30
32
concurrency :
31
33
group : ${{ github.workflow }}-${{ github.ref }}
32
34
steps :
33
35
- name : Checkout code
34
- uses : actions/checkout@v2
36
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
35
37
36
38
- name : Build
37
39
uses : andstor/jsdoc-action@v1
42
44
template : minami
43
45
front_page : README.md
44
46
45
- - name : Deploy
47
+ - name : Deploy if this is the `main` branch
46
48
uses : peaceiris/actions-gh-pages@v3
47
- if : github.ref == 'refs/heads/00119-jsdoc-support'
49
+ if : github.ref == 'refs/heads/main'
50
+ with :
51
+ github_token : ${{ secrets.GITHUB_TOKEN }}
52
+ publish_dir : ./public
53
+
54
+
55
+ - name : Set base URL for preview if PR
56
+ if : github.ref != 'refs/heads/main'
57
+ run : echo "BASE_URL=https://${{ env.DOMAIN }}/${{ github.event.repository.name }}/${{ env.PR_PATH}}/" >> $GITHUB_ENV
58
+
59
+ - name : Deploy to PR preview
60
+ uses : peaceiris/actions-gh-pages@v3
61
+ if : github.ref != 'refs/heads/main'
48
62
with :
49
63
github_token : ${{ secrets.GITHUB_TOKEN }}
50
64
publish_dir : ./out
65
+ destination_dir : ${{ env.PR_PATH }} # TODO you need to set this if you're using a custom domain. Otherwise you can remove it.
66
+
You can’t perform that action at this time.
0 commit comments