Skip to content

Lets add a build pipeline for our repo

Course: CI/CD - chapter 6

Anytime a user creates a PR, we need to run npm run build and only if it succeeds should the workflow succeed

name: Build on PR
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Dependencies
run: npm install
- name: Run Build
run: npm run build
  • Push this to master branch
  • Create a new branch with some minimal changes and create a PR from it
  • You should see the workflow run