I tried to create a github action that operates on ./example folder. Code that is inside /.example folder was built by using create-react-app.
Workflow code:
name: CI
on:
push:
branches: [ origin ]
pull_request:
branches: [ origin ]
jobs:
build_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test example
working-directory: example
run: |
npm install
npm run build --if-present
The structure of my project (inside ./example there is package.json):