node.js - 如何在 github 操作的特定文件夹中运行我的 CI 步骤
问题描述
我有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
文件夹内运行。
需要帮忙。提前致谢。
解决方案
您可以在一个步骤中使用working-directory
关键字。请参阅此处run
的文档。
- run: yarn install
working-directory: client
- run: yarn build
working-directory: client
推荐阅读
- c++ - 将一系列数字映射到 cpp 中的值的简单方法
- angular-material - 在 Angular 8 的 MatIcon 中使用 MatTooltip 导致问题
- python - 'class MyClass:' 和 'class MyClass():' 之间的区别
- javascript - 这个转义函数有什么作用?
- python - 将字符串格式参数指定为日志记录函数参数(logging-not-lazy)
- asp.net - Asp.Net - CustomValidator 的 ErrorMessage - 仅显示在 ValidationSummary - 不在其他地方
- kubernetes - 由于上下文,Kubernetes 部署失败
- postgresql - 模型数据类型中的休眠postgresql时间差异
- python - 自 Catalina 以来,在 Python 中截屏不再适用于 macOS
- ios - Swift - 锁匠将访问级别从 whenUnlocked 修改为 afterFirstUnlock