This is a simple project designed to demonstrate the concept of Continuous Deployment (CD) for beginners using GitHub Actions and GitHub Pages.
Click here to see the live website!
This website is automatically updated every time a new change is merged into the main branch.
We use a simple pipeline: Code Change -> Automatic Deployment.
- A Developer Makes a Change: A developer makes a change to the
index.htmlfile on a new branch and opens a Pull Request. - Code is Merged: After a review, the Pull Request is merged into the
mainbranch. - GitHub Actions Triggers: This merge event automatically triggers a workflow defined in the
.github/workflows/deploy.ymlfile. - The Workflow Runs:
- It checks out the latest code.
- It does a tiny "build" step: it replaces the
VERSION_TIMESTAMPtext inindex.htmlwith the current date and time. This helps us see the new version is live. - It uploads the modified website files as an "artifact."
- It deploys this artifact to GitHub Pages.
- Website is Live! Your changes are now visible on the public GitHub Pages URL for this repository, usually within a minute.
This is Continuous Deployment: a change that passes our process is automatically released to users without any manual intervention.
- Fork this repository to your own GitHub account.
- In your forked repository, go to Settings > Pages.
- Under "Build and deployment", select GitHub Actions as the source.
- Now, make a change to the
index.htmlfile (e.g., change the text in the<h1>tag). - Commit the change to a new branch and open a pull request to merge it into your
mainbranch. - Merge the pull request.
- Go to the "Actions" tab in your repository. You will see the workflow running!
- Once it's complete (with a green checkmark β ), go back to your Settings > Pages to find your public URL and see your changes live!