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
- Fork the main repo - https://github.com/100xdevs-cohort-2/week-18-2-ci-cd
- Add
.github/workflows/build.ymlin the root folder - Create the workflow
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
