gpt4 book ai didi

firebase - travis ci 在 firebase 托管上部署失败

转载 作者:行者123 更新时间:2023-12-01 22:00:10 25 4
gpt4 key购买 nike

我正在尝试将 travis ci 集成到我的 firebase 应用程序中以自动部署,但它无法显示 401 错误。这是我的 .travis.yml

language: node_js
node_js:
- '8'
deploy:
provider: firebase
token:
secure: "BnzKtrzBaI/uLHoezYpBVqQ/VwhIyil...n0jAuBNrTI="
message: build $TRAVIS_BUILD_NUMBER $TRAVIS_BRANCH/$COMMIT_HASH

我收到以下错误:

Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

我不确定出了什么问题。

最佳答案

我以前没有在 Travis CI 中使用过 provider 功能,但是部署到 Firebase 托管的另一种选择是安装 firebase-tools 并使用 CLI。

language: node_js
node_js: 8

before_script:
- npm install firebase-tools -g

script:
- firebase deploy --only hosting --token "BnzK...rTI="

-- 编辑:有关Cloud FunctionsBranch Filters 的更多信息。 --

如果您还要部署 Cloud Functions,则需要先在 travis 上安装 node_modules,然后才能部署。

language: node_js
node_js: 8

before_script:
- npm install firebase-tools -g
- cd functions && npm install

script:
- firebase deploy --only hosting,functions --token "BnzK...rTI="

如果您只想在对 master 分支进行更改时进行部署,您可以在此过滤器中添加。

language: node_js
node_js: 8

before_script:
- npm install firebase-tools -g
- cd functions && npm install

script:
- firebase deploy --only hosting,functions --token "BnzK...rTI="

branches:
only:
- master

关于firebase - travis ci 在 firebase 托管上部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53747936/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com