GitHub - Firebase 部署工作目录
如何为firebase
和github
workflows指定文件夹名称。基本上我有一个.github
文件夹其中.yml
存储文件,但我也有frontend
文件夹,我在其中存储了我的react.js src文件和所需的其他一切。
现在,当我推动更改时,我会得到此错误:
npm ERR! The `npm ci` command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-03-29T10_09_41_940Z-debug-0.log
这是我的.yml
文件:
name: Deploy to Firebase Hosting on merge
"on":
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_REACTTASK_20C61 }}"
channelId: live
projectId: reacttask-20c61
workingdirectory: ./frontend
如何使我的frontend
文件夹是一个工作目录,现在看来它似乎不是
How to specify folder name for the Firebase
and GitHub
workflows. Basically I have a .github
folder where .yml
files are stored but I also have frontend
folder where I store my React.js src files and everything else that is needed.
Now when I push the changes I get this error:
npm ERR! The `npm ci` command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-03-29T10_09_41_940Z-debug-0.log
This is my .yml
file:
name: Deploy to Firebase Hosting on merge
"on":
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_REACTTASK_20C61 }}"
channelId: live
projectId: reacttask-20c61
workingdirectory: ./frontend
How to make it that my frontend
folder is a working directory, beacuse it now seems it is not
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
entrypoint
选项有关更多详细信息,请参见 /a>
Use the
entryPoint
optionfor more details see the docs
非常古老的问题,但这是我的解决方案,以防其他人最终来到这里。
在您的情况下,您需要
working-everectory:./frontend
才能构建。您还需要输入点:./frontend
才能部署到firebase。Pretty old question but here is my solution in case anyone else ended up here.
In your case, you needed
working-directory: ./frontend
to build. You also needentryPoint: ./frontend
to deploy to Firebase.