File tree Expand file tree Collapse file tree 4 files changed +39
-6
lines changed Expand file tree Collapse file tree 4 files changed +39
-6
lines changed Original file line number Diff line number Diff line change 11# This workflow builds and deploys the Docusaurus site.
22#
33# On pull requests, this workflow builds the site and deploys a temporary preview
4- # to gh-pages.
4+ # to gh-pages, but only if the relevant files have changed .
55#
66# On push to master or on workflow dispatch it deploys the site to:
77# https://plutus.cardano.intersectmbo.org/docs
1515 - master
1616 workflow_dispatch :
1717 pull_request :
18+ paths :
19+ - ' doc/docusaurus/**'
20+ - ' .github/workflows/docusaurus-site.yml'
1821
1922jobs :
2023 run :
@@ -49,14 +52,15 @@ jobs:
4952 PR_NUMBER="${{ github.event.pull_request.number }}"
5053 # These match the URL expected by rossjrw/[email protected] : 5154 export DOCUSAURUS_URL="https://plutus.cardano.intersectmbo.org"
52- export DOCUSAURUS_BASE_URL="/pr-preview/pr-${PR_NUMBER}"
55+ export DOCUSAURUS_BASE_URL="/pr-preview/docs/ pr-${PR_NUMBER}"
5356 nix develop --no-warn-dirty --accept-flake-config --command bash -c 'yarn && yarn build'
5457
5558 - name : Deploy Preview Site
56- if : github.event_name == 'pull_request' && github.event.action != 'closed'
59+ if : github.event_name == 'pull_request'
57605861 with :
5962 source-dir : doc/docusaurus/build
63+ umbrella-dir : pr-preview/docs
6064
6165
6266
Original file line number Diff line number Diff line change 7474
7575 - name : Delete Oldest Build
7676 run : |
77- # Delete the oldest haddock build if there are more than 11 builds.
78- if [[ $(ls -1A haddock | wc -l) -gt 11 ]]; then
77+ # Delete the oldest haddock build if there are more than 10 builds.
78+ if [[ $(ls -1A haddock | wc -l) -gt 10 ]]; then
7979 OLDEST_BUILD=$(ls -1A haddock | sort | head -n 1)
8080 rm -rf haddock/$OLDEST_BUILD
8181
Original file line number Diff line number Diff line change 5757 with :
5858 ref : ${{ inputs.ref || github.ref_name }}
5959
60+ - name : Delete Oldest Build
61+ run : |
62+ # Delete the oldest metatheory build if there are more than 10 builds.
63+ if [[ $(ls -1A metatheory | wc -l) -gt 10 ]]; then
64+ OLDEST_BUILD=$(ls -1A metatheory | sort | head -n 1)
65+ rm -rf metatheory/$OLDEST_BUILD
66+
67+ git config user.name "github-actions[bot]"
68+ git config user.email "github-actions[bot]@users.noreply.github.com"
69+ git rm -r --cached metatheory/$OLDEST_BUILD || true
70+ git commit -am "Delete oldest metatheory build $OLDEST_BUILD"
71+ git push origin gh-pages
72+ fi
73+
6074 - name : Build Site
6175 run : |
6276 nix build --accept-flake-config .#metatheory-site
Original file line number Diff line number Diff line change 11# This workflow builds and deploys various papers.
22#
3+ # On pull requests, this workflow builds the papers and deploys a temporary preview
4+ # to gh-pages, but only if the relevant files have changed.
5+ #
36# This workflow runs on all push to master and can also be triggered manually.
47# It deploys the artifacts to: https://plutus.cardano.intersectmbo.org/resources
58
1013 push :
1114 branches :
1215 - master
16+ pull_request :
17+ paths :
18+ - ' doc'
19+ - ' !doc/docusaurus/**'
1320
1421jobs :
1522 deploy :
4249 done
4350
4451 - name : Publish Papers
52+ if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
45534654 with :
4755 folder : _resources
4856 target-folder : resources
49- single-commit : true
57+ single-commit : true
58+
59+ - name : Publish Preview Papers
60+ if : github.event_name == 'pull_request'
61+ 62+ with :
63+ source-dir : _resources
64+ umbrella-dir : pr-preview/resources
You can’t perform that action at this time.
0 commit comments