@@ -3,23 +3,16 @@ name: Build Documentation
33on :
44 push :
55 branches : ["master"]
6- # Specify to run a workflow manually from the Actions tab on GitHub
76 workflow_dispatch :
87
9- # Gives the workflow permissions to clone the repo and create a page deployment
108permissions :
9+ contents : read
1110 id-token : write
1211 pages : write
1312
1413env :
15- # Name of module and id separated by a slash
1614 INSTANCE : Writerside/tl
17- # Replace HI with the ID of the instance in capital letters
18- ARTIFACT : webHelpTL2-all.zip
19- # Writerside docker image version
2015 DOCKER_VERSION : ' 2026.06.8817'
21- CONFIG_JSON_PRODUCT : ' TL'
22- CONFIG_JSON_VERSION : ' 1.0'
2316
2417jobs :
2518 build :
@@ -30,21 +23,36 @@ jobs:
3023 uses : actions/checkout@v4
3124 with :
3225 fetch-depth : 0
26+
27+ - name : Define Instance ID And Artifacts
28+ id : define-ids
29+ run : |
30+ INSTANCE=${INSTANCE#*/}
31+ INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]')
32+ ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip"
33+
34+ # Print the values
35+ echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER"
36+ echo "ARTIFACT: $ARTIFACT"
37+
38+ # Set the environment variables and outputs
39+ echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
40+ echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
41+ echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
42+
3343 - name : Build Docs
3444 uses : JetBrains/writerside-github-action@v4
3545 with :
3646 instance : ${{ env.INSTANCE }}
37- artifact : ${{ env.ARTIFACT }}
3847 docker-version : ${{ env.DOCKER_VERSION }}
39- - name : Upload Documentation
48+
49+ - name : Save Artifact
4050 uses : actions/upload-artifact@v4
4151 with :
4252 name : docs
4353 path : |
44- artifacts/${{ env.ARTIFACT }}
45- artifacts/report.html
54+ artifacts/${{ steps.define-ids.outputs.artifact }}
4655 artifacts/report.json
47- artifacts/${{ env.ALGOLIA_ARTIFACT }}
4856 retention-days : 7
4957
5058 # test:
@@ -65,21 +73,27 @@ jobs:
6573 environment :
6674 name : github-pages
6775 url : ${{ steps.deployment.outputs.page_url }}
76+ # needs: [build, test]
6877 needs : build
6978 runs-on : ubuntu-latest
7079 steps :
7180 - name : Download Artifact
7281 uses : actions/download-artifact@v4
7382 with :
7483 name : docs
84+ path : artifacts
85+
7586 - name : Unzip Artifact
76- run : unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir
87+ run : unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.artifact }}" -d dir
88+
7789 - name : Setup Pages
7890 uses : actions/configure-pages@v4
79- - name : Upload Artifact
91+
92+ - name : Upload Pages Artifact
8093 uses : actions/upload-pages-artifact@v3
8194 with :
8295 path : dir
96+
8397 - name : Deploy to GitHub Pages
8498 id : deployment
8599 uses : actions/deploy-pages@v4
0 commit comments