diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c07742..853e8e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,11 +59,11 @@ deploy-site: - echo "Getting artifacts" - ls public - echo "Stopping screen session, cleaning" - - ssh $DEPLOY_USER@$DEPLOY_HOST "screen -X -S website-fgota-npx kill; rm -r -f fgo-ta_com/fgota-public/*;" + - ssh $DEPLOY_USER@$DEPLOY_HOST "screen -X -S fgo-ta_com-public kill; rm -r -f fgo-ta_com/public/*;" - echo "Copying to proxmox machine" - - rsync -az --stats public/* $DEPLOY_USER@$DEPLOY_HOST:~/fgo-ta_com/fgota-public + - rsync -az --stats public/* $DEPLOY_USER@$DEPLOY_HOST:~/fgo-ta_com/public - echo "Restarting screen session" - - ssh $DEPLOY_USER@$DEPLOY_HOST "cd fgo-ta_com; find fgota-public -maxdepth 1 -printf '%p\n'; screen -S website-fgota-npx -dm npx serve fgota-public/ -p 9200 -c serve.json" + - ssh $DEPLOY_USER@$DEPLOY_HOST "cd fgo-ta_com; find public -maxdepth 1 -printf '%p\n'; screen -S fgo-ta_com-public -dm ~/serve public/ -p 9200" - echo "Website is up on https://fgo-ta.com" @@ -80,5 +80,5 @@ redeploy-site: - echo "Stopping screen session" - ssh $DEPLOY_USER@$DEPLOY_HOST "screen -X -S website-fgota-npx kill" || true - echo "Restarting screen session" - - ssh $DEPLOY_USER@$DEPLOY_HOST "cd fgo-ta_com; screen -S website-fgota-npx -dm npx serve fgota-public/ -p 9200 -c serve.json" + - ssh $DEPLOY_USER@$DEPLOY_HOST "cd fgo-ta_com; screen -S fgo-ta_com-public -dm ~/serve public/ -p 9200" - echo "Website is up on https://fgo-ta.com/" diff --git a/serve.json b/serve.json index acf34e5..3eba146 100644 --- a/serve.json +++ b/serve.json @@ -1,14 +1,20 @@ { - "directoryListing": ["/!assets/**"], + "cleanUrls": true, + "directoryListing": false, + "etag": true, "headers": [ { - "source": "**/*.@(jpg|jpeg|gif|png|webp)", - "headers": [ - { - "key": "Cache-Control", - "value": "no-cache" - } - ] + "source" : "**/*.@(jpg|jpeg|gif|png|webp|svg)", + "headers" : [{ + "key" : "Cache-Control", + "value" : "no-cache" + }] + }, { + "source" : "404.html", + "headers" : [{ + "key" : "Cache-Control", + "value" : "no-cache" + }] } ] }