繁体   English   中英

未找到具有提供的路径的文件:build. 不会上传任何工件。 - Github 将 React 应用程序部署到 Firebase 的操作

[英]No files were found with the provided path: build. No artifacts will be uploaded. - Github Action for deploying React App to Firebase

我正在按照教程使用 github 操作为反应应用程序设置 CI/CD。 我想要构建我的反应应用程序并将其部署到我的 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 }}

我可以从控制台手动安装、构建和部署。 我认为这个错误可能与我的构建目录的位置有关,但它在标准位置。 关于这可能是什么的任何想法?

链接到这里的完整回购

附加截图:

行动结果

似乎从 my.gitignore 中删除/build解决了这个问题。 我不知道为什么 %100,因为我见过的类似操作的例子都没有包括它们的构建文件夹。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM