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:
3030 uses : actions/checkout@main
3131
3232 - name : Build Site
33+ if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
3334 working-directory : doc/docusaurus
3435 run : nix develop --no-warn-dirty --accept-flake-config --command bash -c 'yarn && yarn build'
3536
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-
4237 - name : Deploy Site
4338 if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
44394540 with :
4641 folder : doc/docusaurus/build
4742 target-folder : docs
4843 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 = {
88 favicon : "img/favicon.ico" ,
99
1010 // 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" ,
1212
1313 // Set the /<baseUrl>/ pathname under which your site is served
1414 // For GitHub pages deployment, it is often '/<projectName>/'
15- baseUrl : "/docs/" ,
15+ baseUrl : process . env . DOCUSAURUS_BASE_URL || "/docs/" ,
1616
1717 // GitHub pages deployment config.
1818 // If you aren't using GitHub pages, you don't need these.
You can’t perform that action at this time.
0 commit comments