@@ -10,20 +10,38 @@ inputs:
10
10
description : The path where the build script will output the HTML.
11
11
required : false
12
12
default : ${{ runner.temp }}/docsbuild/build/html
13
+ build-rst :
14
+ description : The path where the build script will output the RST.
15
+ required : false
16
+ default : ${{ runner.temp }}/docsbuild/rst
13
17
copy-build :
14
18
description : |
15
19
If set, copy the built HTML files to this path after building, and set the build-html output to this path instead.
16
20
This is useful if you need to do multiple builds from the same environment, or otherwise need the files to be elsewhere.
17
21
Note: files in the destination that do not exist in the source will be deleted!
18
22
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
19
29
artifact-upload :
20
30
description : If true then upload the rendered docs as a build artifact.
21
31
required : false
22
32
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'
23
37
artifact-name :
24
38
description : The name of the build artifact.
25
39
required : false
26
40
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
27
45
artifact-retention-days :
28
46
description : Number of days to keep the artifact.
29
47
required : false
53
71
echo "::endgroup::"
54
72
55
73
HTML="${{ inputs.build-html }}"
74
+ RST="${{ inputs.build-rst }}"
56
75
COPY_BUILD="${{ inputs.copy-build }}"
76
+ COPY_RST="${{ inputs.copy-rst }}"
57
77
58
78
if [[ "$COPY_BUILD" != "" ]] ; then
59
79
echo "::group::Copy the build files"
@@ -65,14 +85,32 @@ runs:
65
85
echo "::set-output name=build-html::$HTML"
66
86
fi
67
87
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
69
99
if : fromJSON(inputs.artifact-upload)
70
100
uses : actions/upload-artifact@v3
71
101
with :
72
102
path : ${{ steps.build.outputs.build-html }}
73
103
name : ${{ inputs.artifact-name }}
74
104
retention-days : ${{ fromJSON(inputs.artifact-retention-days) }}
75
105
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
+
76
114
- name : Output step
77
115
id : outs
78
116
shell : bash
0 commit comments