@@ -10,20 +10,38 @@ inputs:
1010 description : The path where the build script will output the HTML.
1111 required : false
1212 default : ${{ runner.temp }}/docsbuild/build/html
13+ build-rst :
14+ description : The path where the build script will output the HTML.
15+ required : false
16+ default : ${{ runner.temp }}/docsbuild/rst
1317 copy-build :
1418 description : |
1519 If set, copy the built HTML files to this path after building, and set the build-html output to this path instead.
1620 This is useful if you need to do multiple builds from the same environment, or otherwise need the files to be elsewhere.
1721 Note: files in the destination that do not exist in the source will be deleted!
1822 required : false
23+ copy-rst :
24+ description : |
25+ If set, copy the preprocessed RST files to this path after building, and set the build-rst output to this path instead.
26+ This is useful if you need to do multiple builds from the same environment, or otherwise need the files to be elsewhere.
27+ Note: files in the destination that do not exist in the source will be deleted!
28+ required : false
1929 artifact-upload :
2030 description : If true then upload the rendered docs as a build artifact.
2131 required : false
2232 default : ' true'
33+ rst-artifact-upload :
34+ description : If true then upload the rendered docs as a build artifact.
35+ required : false
36+ default : ' true'
2337 artifact-name :
2438 description : The name of the build artifact.
2539 required : false
2640 default : ${{ github.event.repository.name }}_docs
41+ rst-artifact-name :
42+ description : The name of the RST artifact.
43+ required : false
44+ default : ${{ github.event.repository.name }}_rst
2745 artifact-retention-days :
2846 description : Number of days to keep the artifact.
2947 required : false
5371 echo "::endgroup::"
5472
5573 HTML="${{ inputs.build-html }}"
74+ RST="${{ inputs.build-rst }}"
5675 COPY_BUILD="${{ inputs.copy-build }}"
76+ COPY_RST="${{ inputs.copy-rst }}"
5777
5878 if [[ "$COPY_BUILD" != "" ]] ; then
5979 echo "::group::Copy the build files"
@@ -65,14 +85,32 @@ runs:
6585 echo "::set-output name=build-html::$HTML"
6686 fi
6787
68- - name : Upload artifact
88+ if [[ "$COPY_RST" != "" ]] ; then
89+ echo "::group::Copy the pre-processed files"
90+ mkdir -p "$COPY_RST"
91+ rsync -avc --delete-after "$RST/" "$COPY_RST/"
92+ echo "::set-output name=build-rst::$COPY_RST"
93+ echo "::endgroup::"
94+ else
95+ echo "::set-output name=build-rst::$RST"
96+ fi
97+
98+ - name : Upload HTML artifact
6999 if : fromJSON(inputs.artifact-upload)
70100 uses : actions/upload-artifact@v3
71101 with :
72102 path : ${{ steps.build.outputs.build-html }}
73103 name : ${{ inputs.artifact-name }}
74104 retention-days : ${{ fromJSON(inputs.artifact-retention-days) }}
75105
106+ - name : Upload RST artifact
107+ if : fromJSON(inputs.rst-artifact-upload)
108+ uses : actions/upload-artifact@v3
109+ with :
110+ path : ${{ steps.build.outputs.build-rst }}
111+ name : ${{ inputs.rst-artifact-name }}
112+ retention-days : ${{ fromJSON(inputs.artifact-retention-days) }}
113+
76114 - name : Output step
77115 id : outs
78116 shell : bash
0 commit comments