1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

Merge branch 'tf/mv-site-cfpages' into 'master'

Move site to CloudFlare Pages

See merge request videostreaming/fcast!7
This commit is contained in:
Michael Hollister 2024-11-20 18:43:22 +00:00
commit 58d2b73220
7 changed files with 690 additions and 39 deletions

View file

@ -1,7 +0,0 @@
deployWebsite:
stage: deployWebsite
before_script:
- cd website
script:
- sh deploy.sh
when: manual

View file

@ -1,29 +0,0 @@
#!/bin/sh
DOCUMENT_ROOT=/var/www/fcast
# Take site offline
echo "Taking site offline..."
touch $DOCUMENT_ROOT/maintenance.file
# Swap over the content
echo "Deploying content..."
cp index.html $DOCUMENT_ROOT/
cp privacy-policy.html $DOCUMENT_ROOT/
cp favicon.png $DOCUMENT_ROOT/
cp -r css $DOCUMENT_ROOT/
cp -r images $DOCUMENT_ROOT/
cp -r js $DOCUMENT_ROOT/
cp -r vendor $DOCUMENT_ROOT/
# Notify Cloudflare to wipe the CDN cache
echo "Purging Cloudflare cache..."
curl -X POST "https://api.cloudflare.com/client/v4/zones/018ad3b2bbb3bca14f2dd793ddb78de1/purge_cache" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
sleep 30
# Take site back online
echo "Bringing site back online..."
rm $DOCUMENT_ROOT/maintenance.file