gpt4 book ai didi

使用 Github Action 部署 Firebase

转载 作者:行者123 更新时间:2023-12-05 07:15:46 26 4
gpt4 key购买 nike

我正在尝试使用 Github 的操作将我的代码部署到 firebase。

我收到这个错误

    success Installed "firebase-tools@7.11.0" with binaries:
- firebase
Done in 12.99s.
/home/runner/work/_temp/30a2b6cb-a097-4d73-ac92-5379d0cc6ccf.sh: line 2: firebase: command not found

我的部署代码如下

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: dist
- name: yarn add firebase-tools
run: |
yarn global add firebase-tools
firebase deploy ${{ secrets.firebase_token }} --only hosting:**** --non-interactive
env:
PROJECT_ID: ****

如何全局添加 firebase-tools?

我试过了 https://github.com/marketplace/actions/github-action-for-firebase

但是报错

setting firebase project to ***
Now using project ***

=== Deploying to '***'...

i deploying hosting

✔ Deploy complete!

Project Console: *******************

Error: An unexpected error has occurred.
##[error]Docker run failed with exit code 2

下面是代码。

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: dist
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting:****
env:
FIREBASE_TOKEN: ${{ secrets.firebase_token }}
PROJECT_ID: ****

最佳答案

Docker run failed with exit code 2

这是在 w9jds/firebase-action issue 17 中报告的

For me it works when I remove "--only hosting:prod".
Probably it depends on the plan.

You can't keep --only hosting:prod unless you have your site setup for multi-domain hosting inside of your firebase.json file and one of the sites that you can deploy is called prod.

关于使用 Github Action 部署 Firebase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59513894/

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