forked from OpenSecuritySummit/oss2019
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
29 lines (27 loc) · 833 Bytes
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
version: 0.2
environment_variables:
plaintext:
HUGO_VERSION: "0.49"
BUCKET_NAME: "open-security-summit.com-cdn"
DISTRIBUTION_ID: "E22WEBPD6529KA"
AWS_DEFAULT_REGION: "eu-west-2"
phases:
pre_build:
commands:
- cd $CODEBUILD_SRC_DIR && git submodule init && git submodule update
- echo "CODEBUILD_WEBHOOK_TRIGGER - $CODEBUILD_WEBHOOK_TRIGGER"
build:
commands:
- hugo
post_build:
commands:
- |
if [ "$CODEBUILD_WEBHOOK_TRIGGER" = "branch/master" ]; then
aws s3 sync --acl "public-read" --sse "AES256" public/ s3://${BUCKET_NAME}/2019/;
aws configure set preview.cloudfront true;
aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths '/*';
fi
artifacts:
files:
- '**/*'
base-directory: 'public'