File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Docs
1+ # Documentation Deployment Pipeline
2+ #
3+ # - PR with docs changes: build a /-rooted bundle
4+ # - push to main with docs changes: build /Apollon/-rooted bundle and deploy
5+ # it to GitHub Pages
26
3- # - PR with docs changes: build a /-rooted bundle (preview)
4- # - push to main with docs changes: build /Apollon/-rooted bundle, deploy
5- # to GitHub Pages
7+ name : Docs
68
79on :
810 push :
911 branches : [main]
1012 paths :
1113 - " docs/**"
1214 - " library/**"
15+ - " package.json"
1316 - " pnpm-lock.yaml"
1417 - " pnpm-workspace.yaml"
18+ - " .nvmrc"
1519 - " .github/workflows/docs.yml"
1620 pull_request :
21+ types : [opened, synchronize, reopened]
1722 paths :
1823 - " docs/**"
1924 - " library/**"
25+ - " package.json"
26+ - " pnpm-lock.yaml"
27+ - " pnpm-workspace.yaml"
28+ - " .nvmrc"
2029 - " .github/workflows/docs.yml"
2130 workflow_dispatch :
2231
2332permissions :
2433 contents : read
25- pages : write
26- id-token : write
2734
2835concurrency :
2936 group : docs-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref }}
4855
4956 - id : flag
5057 run : |
51- if [[ "${{ github.event_name }}" == "push " && "${{ github.ref }}" == "refs/heads/main " ]]; then
58+ if [[ "${{ github.ref }}" == "refs/heads/main " && "${{ github.event_name }}" != "pull_request " ]]; then
5259 echo "is-production=true" >> "$GITHUB_OUTPUT"
5360 else
5461 echo "is-production=false" >> "$GITHUB_OUTPUT"
7481 env :
7582 DOCUSAURUS_BASE_URL : ${{ steps.flag.outputs.is-production == 'true' && '/Apollon/' || '/' }}
7683
77- - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
78- with :
79- name : docs-build
80- path : docs/build
81- retention-days : 7
82- if-no-files-found : error
83-
8484 - if : steps.flag.outputs.is-production == 'true'
8585 uses : actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
8686 with :
9191 needs : build
9292 if : needs.build.outputs.is-production == 'true'
9393 runs-on : ubuntu-latest
94+ permissions :
95+ pages : write
96+ id-token : write
9497 environment :
9598 name : github-pages
9699 url : ${{ steps.deployment.outputs.page_url }}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ const config: Config = {
3838 } ,
3939
4040 url : "https://ls1intum.github.io" ,
41- // Surge preview ( '/') vs GitHub Pages production ( '/Apollon/') .
41+ // Pull request builds use '/', GitHub Pages production uses '/Apollon/'.
4242 baseUrl : process . env . DOCUSAURUS_BASE_URL || "/Apollon/" ,
4343 organizationName : "ls1intum" ,
4444 projectName : "Apollon" ,
You can’t perform that action at this time.
0 commit comments