I have a golang
repo with a react
client. I want to setup up CI using github actions for my client. The React client is inside the client
folder in the workspace.
I have written the following workflow
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
But on committing it shows the following error
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
The snippet
- uses: actions/checkout@v2
with:
path: client
doesn't make the steps following run inside the client
folder.
Need help. Thanks in advance.
GitHub Actions uses YAML syntax to define the workflow. Each workflow is stored as a separate YAML file in your code repository, in a directory named .github/workflows . You can create an example workflow in your repository that automatically triggers a series of commands whenever code is pushed.
Not at this moment. Only jobs can run in parallel, but steps always run sequentially.
You can use the working-directory
keyword in a run
step. See the documentation here.
- run: yarn install
working-directory: client
- run: yarn build
working-directory: client
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With