Hello, I have the following config:
version: 2.1
orbs:
node: circleci/node@2.0.3
jobs:
build-and-test:
executor:
name: node/default
steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Build Pages
command: yarn build:login
build-and-deploy:
executor:
name: node/default
steps:
- checkout
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- run:
name: Build Pages
command: yarn build:login
- run:
name: Deploy to Auth0
command: VERSION=$(node -p "'my-package@' + require('./package.json').version") yarn deploy
workflows:
build-and-test:
jobs:
- build-and-test
build-and-deploy-staging:
jobs:
- build-and-deploy:
context: my-package-staging
filters:
branches:
only: next
build-and-deploy-production:
jobs:
- build-and-deploy:
context: my-package-production
filters:
tags:
only: /^v.*/
I would like to run the build-and-test
job only when developers create a pull request on the master
branch. Any idea how I can do this?