File tree Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -30,19 +30,34 @@ jobs:
30
30
uses : actions/checkout@main
31
31
32
32
- name : Build Site
33
+ if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
33
34
working-directory : doc/docusaurus
34
35
run : nix develop --no-warn-dirty --accept-flake-config --command bash -c 'yarn && yarn build'
35
36
36
- - name : Deploy Preview
37
- if : github.event_name == 'pull_request' && github.event.action != 'closed'
38
- uses : rossjrw/pr-preview-action@v1
39
- with :
40
- source-dir : doc/docusaurus/build
41
-
42
37
- name : Deploy Site
43
38
if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
44
39
45
40
with :
46
41
folder : doc/docusaurus/build
47
42
target-folder : docs
48
43
single-commit : true
44
+
45
+ - name : Build Preview Site
46
+ if : github.event_name == 'pull_request' && github.event.action != 'closed'
47
+ working-directory : doc/docusaurus
48
+ run : |
49
+ PR_NUMBER="${{ github.event.pull_request.number }}"
50
+ # These match the URL expected by rossjrw/pr-preview-action@v1:
51
+ export DOCUSAURUS_URL="https://plutus.cardano.intersectmbo.org"
52
+ export DOCUSAURUS_BASE_URL="/pr-preview/pr-${PR_NUMBER}"
53
+ nix develop --no-warn-dirty --accept-flake-config --command bash -c 'yarn && yarn build'
54
+
55
+ - name : Deploy Preview Site
56
+ if : github.event_name == 'pull_request' && github.event.action != 'closed'
57
+ uses : rossjrw/pr-preview-action@v1
58
+ with :
59
+ source-dir : doc/docusaurus/build
60
+
61
+
62
+
63
+
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ const config: Config = {
8
8
favicon : "img/favicon.ico" ,
9
9
10
10
// Set the production url of your site here
11
- url : "https://plutus.cardano.intersectmbo.org" ,
11
+ url : process . env . DOCUSAURUS_URL || "https://plutus.cardano.intersectmbo.org" ,
12
12
13
13
// Set the /<baseUrl>/ pathname under which your site is served
14
14
// For GitHub pages deployment, it is often '/<projectName>/'
15
- baseUrl : "/docs/" ,
15
+ baseUrl : process . env . DOCUSAURUS_BASE_URL || "/docs/" ,
16
16
17
17
// GitHub pages deployment config.
18
18
// If you aren't using GitHub pages, you don't need these.
You can’t perform that action at this time.
0 commit comments