TravisCI deploy website to firebase
28 Nov 2018Use ubuntu
docker image
docker pull ubuntu
Run docker container
docker run -it --rm -v /website:/website -p 9005:9005 ubuntu bash
Inside of docker container
apt-get update -y
apt-get install npm ruby git ruby-dev -y
firebase
Run firebase 1, Make sure you have 9005 port
npm install -g firebase-tools
cd /website
firebase login:ci
firebase init
export FIREBASE_TOKEN=TOKEN
echo $FIREBASE_TOKEN
firebase json firebase.json
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
firebase config .firebaserc
{
"projects": {
"default": "project-id"
}
}
Travis CI
Install 2
gem install travis --no-rdoc --no-ri
travis login --com --auto
travis encrypt "key string" --pro
travis encrypt "key string" --pro --add