-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeployBlog.sh
executable file
·53 lines (37 loc) · 1.1 KB
/
deployBlog.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
####################################
# #
# CONFIG #
# #
####################################
YOUR_DOMAIN=""
####################################
# #
# DONT TOUCH #
# #
####################################
BASKET='\U1F5D1\UFE0F '
CHECKMARK='\U2705 '
PACKAGE='\U1F4E6 '
HAMMER='\U1F6E0\UFE0F '
BUCKET_NAME="${YOUR_DOMAIN}-cdn"
printf "${PACKAGE}"
echo "Cloning packages locally..."
git clone https://github.com/sa7mon/academic-kickstart.git blog
cd blog/
git submodule update --init --recursive
printf "${CHECKMARK}"
echo "Done!"
echo ""
printf "${HAMMER}"
echo "Building static site..."
hugo
printf "${CHECKMARK}"
echo "Done!"
echo ""
printf "${BASKET}"
echo "Uploading public site files to S3 bucket..."
aws s3 sync --acl "public-read" public/ s3://${BUCKET_NAME} --exclude 'post' --only-show-errors
printf "${CHECKMARK}"
echo "Done!"
echo ""
# aws cloudfront list-distributions --output text --query "DistributionList.Items[].{DomainName: DomainName, Id: Id, OriginDomainName: Origins.Items[0].DomainName}[?contains(OriginDomainName, '${YOUR_DOMAIN}')] | [0].Id"