File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - develop
7+ - prod
78
89jobs :
910 build_and_sync :
3839 echo $bucket; \
3940 echo "bucket=$bucket" >> $GITHUB_OUTPUT
4041 id : bucket_name
42+
43+ - name : Get distribution ID
44+ shell : bash
45+ run : |
46+ branch=$(echo ${GITHUB_REF#refs/heads/}); \
47+ if [ $branch == 'develop' ]; \
48+ then dist=E3SMW2DYY71HHW; \
49+ elif [ $branch == 'prod' ]; \
50+ then dist=E1CUT1CP31D5NK; \
51+ else exit 1; fi; \
52+ echo $dist; \
53+ echo "dist=$dist" >> $GITHUB_OUTPUT
54+ id : dist_id
4155
4256 - name : Configure AWS credentials
4357 uses : aws-actions/configure-aws-credentials@v1
5266 shell : bash
5367 run : |
5468 aws s3 sync apidocs/_build/html s3://${AWS_S3_BUCKET}/apidocs/
69+
70+ - name : Invalidate CloudFront cache
71+ env :
72+ DISTRIBUTION_ID : ${{ steps.dist_id.outputs.dist }}
73+ run : |
74+ aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths "/apidocs/*"
You can’t perform that action at this time.
0 commit comments