Static Site CI/CD Pipeline
Auto-deploy a static site on every push with GitHub Actions.
0 of 6 steps
What you will end up with
A working CI/CD pipeline
Automated deploys on push
Build status badges
Build steps
0/6Start a new GitHub repo and push a plain index.html. It is an empty notebook, and this is the first page.
Add a .github/workflows/deploy.yml file with a job that runs on every push. Think of it as a robot that wakes up each time you push and follows a checklist.
Use actions/cache to save the node_modules folder between runs so npm install skips work it already did. It is like keeping groceries in the fridge instead of shopping from scratch every day.
Add a deploy step that only runs when the branch is main. Picture a door that only unlocks when you are standing at the main entrance, never the side doors.
Copy the workflow badge markdown from the Actions tab and paste it at the top of README.md. It is a green or red sticker that tells visitors whether the last build passed.
In repo Settings then Branches, add a rule so main cannot be merged until CI passes. Think of it as a bouncer who checks ID before anyone gets through the front door.
Before you start