reactjs - 未找到具有提供的路径的文件:build. 不会上传任何工件。- 将 React App 部署到 Firebase 的 Github Action
问题描述
我正在关注本教程,了解如何使用 github 操作为 react 应用程序设置 CI/CD。我想要构建我的 react 应用程序并将其部署到我的 firebase 项目以进行托管的操作。我很确定我已按照指示进行操作,但是当我通过推送触发我的操作时,我收到此错误:
> Run actions/download-artifact@v2
> with:
> name: build
> path: build Starting download for build Error: Unable to find any artifacts for the associated workflow
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Firebase CI
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/f
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Archive Build
uses: actions/upload-artifact@v2
with:
name: build
path: build
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download Build
uses: actions/download-artifact@v2
with:
name: build
path: build
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
我可以从控制台手动安装、构建和部署。我认为这个错误可能与我的构建目录的位置有关,但它在标准位置。关于这可能是什么的任何想法?
链接到这里的完整回购
附加截图:
解决方案
似乎/build
从我的 .gitignore 中删除解决了这个问题。我不知道为什么 %100,因为我见过的类似操作的例子都没有包括它们的构建文件夹。
推荐阅读
- python - 如何在 Python 和 BeautifulSoup 中将标题与 url 链接?
- python-3.x - 如何获取“member.activity”的片段以及如何发送自定义状态(discord.py)
- tensorflow - 在微调 PEGASUS 中改变权重衰减和预热步骤有什么影响?
- c - C中的简单计算器:如何拒绝除数字以外的任何输入,为什么错误消息会无限打印?
- django - 如何在 DRF viewsets.ModelViewSet 中查询相关对象
- java - 如何仅使用图像训练 Tesseract4J
- git - 添加新的 create-react-app 文件夹时出现“警告:添加嵌入式 git 存储库”
- android - 当状态栏背景为白色时,将状态栏文本颜色更改为黑色
- sql - 无法使用 WINDOW 函数计算 DISTINCT (Spark SQL)
- c++ - 错误 LNK2019:函数 _vfprintf_l 中引用的未解析的外部符号 __stdio_common_vfprintf