我有一个golang
客户的react
回购。我想使用github动作为我的客户端设置CI。 React客户端位于工作区中的client
文件夹中。
我编写了以下工作流程
name : Node.js CI
on: [push, pull_request]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: client
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: yarn install
- run: yarn build
但是在提交时会显示以下错误
Run yarn build1s
##[error]Process completed with exit code 1.
Run yarn build
yarn run v1.21.1
error Couldn't find a package.json file in "/home/runner/work/evential/evential"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Process completed with exit code 1
摘要
- uses: actions/checkout@v2
with:
path: client
不会在client
文件夹中运行以下步骤。
需要帮助。预先感谢。
答案 0 :(得分:2)
您可以在working-directory
步骤中使用run
关键字。请参阅文档here。
- run: yarn install
working-directory: client
- run: yarn build
working-directory: client