File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,20 @@ jobs:
23
23
uses : ./.github/actions/execute-notebooks
24
24
25
25
- name : Make BASE_URL
26
- run : echo ${{ github.ref }} | sed "s/[^0-9]//g" | (v=$(cat); echo -e "BASE_URL=/pr-preview/pr-$v/" ) >> $GITHUB_ENV
26
+ uses : actions/github-script@v6
27
+ id : base-url
28
+ with :
29
+ script : |
30
+ const refName = "${{ github.ref_name }}"; // PR_NUMBER/merge
31
+ const prNumber = refName.slice(0, refName.length - 6);
32
+ const baseUrl = `/pr-preview/pr-${prNumber}/`;
33
+ return baseUrl;
34
+ result-encoding : string
27
35
28
36
- name : Build
29
37
uses : ./.github/actions/build
30
38
with :
31
- base-url : $BASE_URL
39
+ base-url : ${{ steps.base-url.outputs.result }}
32
40
33
41
- name : Deploy preview
34
42
uses : rossjrw/pr-preview-action@v1
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const config = {
13
13
title : "Introduction to Algorithms" ,
14
14
// tagline: '',
15
15
url : "https://sikepuri-algorithm.github.io" ,
16
- baseUrl : process . env . NODE_ENV ? "/" : process . env . BASE_URL ,
16
+ baseUrl : process . env . NODE_ENV === "development" ? "/" : process . env . BASE_URL ,
17
17
onBrokenLinks : "throw" ,
18
18
onBrokenMarkdownLinks : "warn" ,
19
19
favicon : "img/favicon.ico" ,
You can’t perform that action at this time.
0 commit comments