THU Hole react frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
965 B

language: node_js
node_js:
- 12
cache:
directories:
- node_modules
after_success:
- git config --global user.name "thuhole"
- git config --global user.email "[email protected]"
- git remote rm origin
- git remote add origin https://thuhole:${GH_TOKEN}@github.com/thuhole/webhole.git
- CI=false REACT_APP_BUILD_INFO=$(printf "Travis%s" "$(TZ=Asia/Shanghai date +"%y%m%d%H%M%S")") npm run build
#额,这里用了个骚操作来修复Service Worker在Precache CDN内容的时候index.html返回content-type text/plain的问题
- sed -i 's/\/\/cdn.jsdelivr.net\/gh\/thuhole\/webhole@gh-pages-master\/index.html/.\/index.html/g' build/*-*
- sed -i 's/\/\/cdn.jsdelivr.net\/gh\/thuhole\/webhole@gh-pages-master\/service-worker.js/.\/service-worker.js/g' build/*-*
- sed -i 's/"\/\/cdn.jsdelivr.net\/gh\/thuhole\/webhole@gh-pages-master","\/service-worker.js"/".","\/service-worker.js"/' build/static/js/*.js
- npm run deploy