@@ -59,19 +59,38 @@ commands:
5959 steps :
6060 - attach_workspace :
6161 at : /tmp/dist
62- - aws-cli/install
63- - aws-s3/sync :
64- arguments : --cache-control public,max-age=300,stale-while-revalidate=300 --exclude * --include *.html --include *.txt --include *.json --include *.md --include *.xml
65- from : /tmp/dist/s2-docs/<< parameters.dir >>
66- to : << parameters.bucket >>
67- - aws-s3/sync :
68- arguments : --cache-control public,max-age=300,stale-while-revalidate=300 --content-type text/x-component;charset=utf-8 --exclude * --include *.rsc
69- from : /tmp/dist/s2-docs/<< parameters.dir >>
70- to : << parameters.bucket >>
71- - aws-s3/sync :
72- arguments : --cache-control public,max-age=31536000,immutable --include * --exclude *.html --exclude *.rsc --exclude *.txt --exclude *.json --exclude *.md --exclude *.xml
73- from : /tmp/dist/s2-docs/<< parameters.dir >>
74- to : << parameters.bucket >>
62+ - when :
63+ condition :
64+ and :
65+ - not :
66+ equal : [ "", "${AWS_ACCESS_KEY_ID}" ]
67+ - not :
68+ equal : [ "", "${AWS_SECRET_ACCESS_KEY}" ]
69+ steps :
70+ - aws-cli/install
71+ - aws-s3/sync :
72+ arguments : --cache-control public,max-age=300,stale-while-revalidate=300 --exclude * --include *.html --include *.txt --include *.json --include *.md --include *.xml
73+ from : /tmp/dist/s2-docs/<< parameters.dir >>
74+ to : << parameters.bucket >>
75+ - aws-s3/sync :
76+ arguments : --cache-control public,max-age=300,stale-while-revalidate=300 --content-type text/x-component;charset=utf-8 --exclude * --include *.rsc
77+ from : /tmp/dist/s2-docs/<< parameters.dir >>
78+ to : << parameters.bucket >>
79+ - aws-s3/sync :
80+ arguments : --cache-control public,max-age=31536000,immutable --include * --exclude *.html --exclude *.rsc --exclude *.txt --exclude *.json --exclude *.md --exclude *.xml
81+ from : /tmp/dist/s2-docs/<< parameters.dir >>
82+ to : << parameters.bucket >>
83+ - unless :
84+ condition :
85+ and :
86+ - not :
87+ equal : [ "", "${AWS_ACCESS_KEY_ID}" ]
88+ - not :
89+ equal : [ "", "${AWS_SECRET_ACCESS_KEY}" ]
90+ steps :
91+ - run :
92+ name : Skip S3 deployment
93+ command : echo "AWS credentials not found. Skipping S3 deployment."
7594
7695jobs :
7796 install :
0 commit comments