构建时 GitHub 操作崩溃

Mou*_*ier 5 npm devops github-actions

我对 DevOps 的世界真的很陌生,我想把我的脚趾浸入水中。这就是为什么我一直在尝试设置一个简单的 GitHub Action,当我推送到 master 时,我的站点会自动部署到 Firebase,但在构建阶段出现问题:

Run npm run build
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/runner/work/ChezMout/ChezMout/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/runner/work/ChezMout/ChezMout/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2020-01-12T12_04_27_341Z-debug.log
##[error]Process completed with exit code 254.
Run Code Online (Sandbox Code Playgroud)

这是我的基本工作流程:

name: Build and Deploy
on:
  push:
    branches:
      - master

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Install Dependencies
        run: npm install
      - name: Build 
        run: npm run build

  deploy:
    name: Deploy
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to Firebase
        uses: w9jds/firebase-action@v1.1.0
        with:
          args: deploy
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
          PROJECT_ID: chez-mout
Run Code Online (Sandbox Code Playgroud)

有什么我在做的明显错误吗?

sct*_*thi 6

npm install无法找到该package.json文件。请确保它存在于您的存储库的根文件夹中。(并且受版本控制且有效)。