-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·35 lines (27 loc) · 1.14 KB
/
deploy.sh
File metadata and controls
executable file
·35 lines (27 loc) · 1.14 KB
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
#!/bin/bash
set -e
echo "Production Deployment for multiplicationmaster"
echo "=============================================="
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo -e "\n${YELLOW}Step 1: Building CSS assets...${NC}"
cd gameon && npx grunt less && cd ..
echo -e "${GREEN}Assets built${NC}"
echo -e "\n${YELLOW}Step 2: Syncing static files to R2${NC}"
R2_ENDPOINT="https://f76d25b8b86cfa5638f43016510d8f77.r2.cloudflarestorage.com"
SYNC_OPTS="--endpoint-url $R2_ENDPOINT --size-only"
aws s3 sync ./static s3://multiplicationmasterstatic/static $SYNC_OPTS
aws s3 sync ./gameon/static s3://multiplicationmasterstatic/gameon/static $SYNC_OPTS
aws s3 sync ./templates s3://multiplicationmasterstatic/templates $SYNC_OPTS
echo -e "${GREEN}Static files synced to R2${NC}"
echo -e "\n${YELLOW}Step 3: Clearing Cloudflare cache${NC}"
if [[ -n "$CLOUDFLARE_API_KEY" && -f "../netwrck/clear_caches.py" ]]; then
python3 ../netwrck/clear_caches.py
echo -e "${GREEN}Cache cleared${NC}"
else
echo -e "${YELLOW}Skipping cache clear${NC}"
fi
echo -e "\n${GREEN}Deployment complete!${NC}"
echo "Next: Upload and restart server"