[英]Unable to deploy firebase functions from github action
我看到了与此类似的问题,但我在这里有一个可能感兴趣的特定用例,我收到一个错误,这显然意味着firebase-functions
没有在 docker 容器上正确安装,在本地一切正常。
整个部署工作完美,在 docker 容器中创建的文件结构看起来正确, node_modules
被放置在正确的文件夹中,一切。
是否需要启用 docker 以将端口暴露给 firebase 部署以获得正确的下载? 有人有这方面的经验吗?
错误
[2022-10-08T08:09:34.513Z] Building nodejs source
i functions: Loaded environment variables from .env.development.
[2022-10-08T08:09:34.518Z] Could not find functions.yaml. Must use http discovery
[2022-10-08T08:09:34.533Z] Error: spawn ./node_modules/.bin/firebase-functions ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
动作.yml
deploy-cloud:
name: Deploy Cloud
needs: e2e-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Checkout Repo
uses: actions/checkout@master
- name: Make envfile
uses: docker://xxxxxx/create-envfile:master
with:
...env vars...
directory: functions
file_name: .env.development
fail_on_empty: false
- name: Install Dependencies
working-directory: functions
run: yarn
- name: Build
working-directory: functions
run: yarn build
- name: Deploy to Firebase
uses: docker://xxxxxx/firebase-action:master
with:
args: deploy --project development --only functions --debug
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
Dockerfile 用于部署操作
FROM node:16.16.0-buster
LABEL version="0.0.1"
LABEL repository="https://github.com/xxxxxx/firebase-action"
LABEL homepage="https://github.com/xxxxxx/firebase-action"
LABEL maintainer="xxxxxx"
LABEL com.github.actions.name="GitHub Action for Firebase"
LABEL com.github.actions.description="Wraps the firebase-tools CLI to enable common commands."
LABEL com.github.actions.icon="package"
LABEL com.github.actions.color="gray-dark"
RUN apt update && apt-get install -y jq openjdk-11-jre
RUN npm i -g npm@8.10.0
RUN npm i -g firebase-tools@11.8.0
COPY LICENSE README.md /
COPY "entrypoint.sh" "/entrypoint.sh"
ENTRYPOINT ["/entrypoint.sh"]
CMD ["--help"]
我可以确认降级到firebase-tools
10.0.0 修复了这个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.