将运行版本反应到Firebase托管
文件已上传到Firebase,不显示任何页面,资源已下载,因为它们可以在开发工具的“网络”选项卡中看到。 从本地环境部署应用程序后,它可以正常运行(在我的计算机xD上运行)
firebase.json:
"hosting": {
"public": "build",
}
gitlab-ci.yam
image: node:10.11.0 # can be upgraded, depending on your node version used
stages:
- build
- deploy
cache:
paths:
- ref_project/node_modules/
build:
stage: build
script:
- echo "Build"
- cd ref_project
- npm i
- CI=false npm run build
artifacts:
paths:
- ./ref_project/build
- ./ref_project/firebase.json
- ./ref_project/.firebaserc
only:
- Production
deploy:
stage: deploy
script:
- echo "Deploy"
- cd ref_project
- npm -g config set user root
- npm i -g firebase-tools
- firebase use ref-project-996a7 --token $FIREBASE_TOKEN
- firebase deploy --only hosting --token $FIREBASE_TOKEN
only:
- Production