File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ inputs:
13
13
build_path :
14
14
description : The directory to upload
15
15
default : ./builtdocs/
16
+ switcher_path :
17
+ description : The path to the switcher relative to the build_path
18
+ default : _static/switcher.json
16
19
17
20
runs :
18
21
using : " composite"
@@ -46,14 +49,16 @@ runs:
46
49
WEEK_CACHE : " 315360" # 3600 * 24 * 7
47
50
YEAR_CACHE : " 31536000" # 3600 * 24 * 365
48
51
BUILD_PATH : " ${{ inputs.build_path }}"
52
+ SWITCHER_PATH : " ${{ inputs.switcher_path }}"
49
53
S3_URL : " ${{ inputs.url }}"
50
54
CLOUDFRONT_ID : " ${{ inputs.cloudfront_id }}"
51
55
VERSION : " ${{ inputs.version }}"
52
56
run : |
53
57
echo "::group::Upload main"
54
58
aws s3 sync --delete "$BUILD_PATH" "$S3_URL/en/docs/latest" --cache-control max-age=$WEEK_CACHE,public
55
- # aws s3 sync --delete "$BUILD_PATH" "$S3_URL/en/docs/$VERSION" --cache-control max-age=$YEAR_CACHE,public
56
- aws cloudfront create-invalidation --distribution-id "$CLOUDFRONT_ID" --paths "/en/docs/latest*" "/en/docs/$VERSION*"
59
+ aws s3 sync --delete "$BUILD_PATH" "$S3_URL/en/docs/$VERSION" --cache-control max-age=$YEAR_CACHE,public
60
+ aws s3 cp "$BUILD_PATH$SWITCHER_PATH" "$S3_URL" --cache-control max-age=$WEEK_CACHE,public
61
+ aws cloudfront create-invalidation --distribution-id "$CLOUDFRONT_ID" --paths "/en/docs/latest*" "/en/docs/$VERSION*" "/switcher.json"
57
62
echo "::endgroup::"
58
63
- name : dryrun
59
64
shell : bash -e {0}
You can’t perform that action at this time.
0 commit comments