ank*_*ena 6 node.js github-actions
我有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 Code Online (Sandbox Code Playgroud)
但是在提交时显示以下错误
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
Run Code Online (Sandbox Code Playgroud)
片段
- uses: actions/checkout@v2
with:
path: client
Run Code Online (Sandbox Code Playgroud)
不会在client文件夹内运行以下步骤。
需要帮忙。提前致谢。
pet*_*ans 16
working-directory您可以在步骤中使用关键字run。请参阅此处的文档。
- run: yarn install
working-directory: client
- run: yarn build
working-directory: client
Run Code Online (Sandbox Code Playgroud)
假设您的存储库结构如下所示:
\n.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 README.md\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 client\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 ... # your source files\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 workflows\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 example-ci.yml\nRun Code Online (Sandbox Code Playgroud)\n您还可以使用以下命令设置多个步骤的默认工作目录:
\n.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 README.md\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 client\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 ... # your source files\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 workflows\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 example-ci.yml\nRun Code Online (Sandbox Code Playgroud)\n这样您就不需要为每个步骤指定它。\n您还可以根据放置上述代码片段的位置来调整范围,无论是:
\n