mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 21:59:00 +02:00
9b59dcded9
Script for CDN upload GitOrigin-RevId: f90a3b07178d8a231a2a7babac52bed3577065c1
15 lines
497 B
Bash
Executable File
15 lines
497 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Upload to staging CDN if branch is either 'master' or 'staging-master'
|
|
if [[ "$BRANCH_NAME" == "master" || "$BRANCH_NAME" == "staging-master" ]]; then
|
|
tar --directory=/tmp/ -xzf build.tar.gz ./public/
|
|
gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_STAG
|
|
# Only upload to production CDN if branch is
|
|
if [[ "$BRANCH_NAME" == "master" ]]; then
|
|
gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_PROD
|
|
fi
|
|
fi
|
|
|
|
|