CI
What does CI mean
In written form it is Continuous Integration It checks if your code is ready for integration for test and staging environments. Those 3 steps are usually done:
- Dependencies are installed
- The code is built
- The tests in the code are ran
Example in practice
- With the
on
we are saying, that when something is pushed to themain
branch or if a pll request is opened on github, it should start running the pipeline - In
jobs
we say what should be executed. In future you will see more of these jobs - In
build
job we got oursteps
, so everything which needs to be ran. In this case it will run on ubuntu 22.04 and it will get the code, setup node js, install dependencies, build the application and than run als
of the folder
name: CI Refcard
on:
push:
branches:
- main
pull_request:
types: [opened, reopened]
jobs:
build:
runs-on: ubuntu-22.04 ## Job machine uses specific version, as latest might cause newer ubuntu versions, which might break the code compatibility
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: npm i
- run: npm run build
- run: ls -la build