55 lines
1.3 KiB
Bash
55 lines
1.3 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
# Deploy quiXzoom Asia pages to S3
|
||
|
|
# Requires: AWS CLI configured with appropriate credentials
|
||
|
|
|
||
|
|
set -e
|
||
|
|
|
||
|
|
BUCKET="quixzoom-asia"
|
||
|
|
REGION="ap-southeast-1"
|
||
|
|
DISTRIBUTION_ID="E1234567890ABC" # Update with actual CloudFront distribution ID
|
||
|
|
|
||
|
|
echo "=== quiXzoom Asia Deployment ==="
|
||
|
|
echo "Bucket: $BUCKET"
|
||
|
|
echo "Region: $REGION"
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
# Sync all language pages
|
||
|
|
echo "Uploading language pages..."
|
||
|
|
aws s3 sync . s3://$BUCKET/ \
|
||
|
|
--exclude "*.sh" \
|
||
|
|
--exclude "*.md" \
|
||
|
|
--exclude ".git/*" \
|
||
|
|
--cache-control "max-age=3600" \
|
||
|
|
--region $REGION
|
||
|
|
|
||
|
|
# Set content types for HTML files
|
||
|
|
echo "Setting content types..."
|
||
|
|
aws s3 cp s3://$BUCKET/ s3://$BUCKET/ \
|
||
|
|
--recursive \
|
||
|
|
--exclude "*" \
|
||
|
|
--include "*.html" \
|
||
|
|
--content-type "text/html; charset=utf-8" \
|
||
|
|
--metadata-directive REPLACE \
|
||
|
|
--region $REGION
|
||
|
|
|
||
|
|
# Set content type for SVG
|
||
|
|
echo "Setting SVG content types..."
|
||
|
|
aws s3 cp s3://$BUCKET/ s3://$BUCKET/ \
|
||
|
|
--recursive \
|
||
|
|
--exclude "*" \
|
||
|
|
--include "*.svg" \
|
||
|
|
--content-type "image/svg+xml" \
|
||
|
|
--metadata-directive REPLACE \
|
||
|
|
--region $REGION
|
||
|
|
|
||
|
|
# Invalidate CloudFront cache
|
||
|
|
echo "Invalidating CloudFront cache..."
|
||
|
|
aws cloudfront create-invalidation \
|
||
|
|
--distribution-id $DISTRIBUTION_ID \
|
||
|
|
--paths "/*" \
|
||
|
|
--region $REGION
|
||
|
|
|
||
|
|
echo ""
|
||
|
|
echo "=== Deployment Complete ==="
|
||
|
|
echo "https://quixzoom.asia/"
|