GitHub Pages Deployment

Write a simple GitHub Actions workflow to deploy a static website to GitHub Pages.

Start building, submit solution and get feedback from the community.
2Submit Solution·
5 upvotes10 upvotes

The goal of this project is to help you learn the notion of continuous integration and continuous deployment. You will write a simple GitHub Actions workflow to deploy a static website to GitHub Pages.

Requirements

You are required to write a GitHub action that deploys any changes made to the index.html file to GitHub Pages. It should only deploy the file when the index.html file is changed.

Here are the steps to get you started:

  • Create a GitHub repository for the project called gh-deployment-workflow for example.
  • Repository should contain a simple index.html file saying “Hello, GitHub Actions!”
  • It should also have a README.md file explaining the project.
  • There should also be a deploy.yml file in the .github/workflows directory which contains the GitHub Actions workflow to deploy the website to GitHub Pages.
  • Every push to the main branch that changes the index.html file should trigger the workflow to run and deploy the website to GitHub Pages.
  • Website and any changes you make should be accessible at the GitHub pages URL for the repository e.g. https://<username>.github.io/gh-deployment-workflow/.

Stretch goal: You can also make this project more practical e.g. use some sort of a static site generator such as Hugo, Jekyll, Astro or similar generator to create a more complex website e.g. your own personal portfolio.


After finishing this project, you will have a good understanding of the following concepts:

  • GitHub Actions
  • GitHub Pages
  • Continuous Integration and Continuous Deployment
  • Writing GitHub Actions workflows

Continue solving more projects for advanced CI/CD concepts.

Found a mistake? Help us improve.

Actively Maintained

We are always improving our content, adding new resources and adding features to enhance your learning experience.

Join the Community

roadmap.sh is the 7th most starred project on GitHub and is visited by hundreds of thousands of developers every month.

Rank 7th  out of 28M!

296K

GitHub Stars

Star us on GitHub
Help us reach #1

+90k every month

+1M

Registered Users

Register yourself
Commit to your growth

+1.5k every month

28K

Discord Members

Join on Discord
Join the community

Roadmaps Best Practices Guides Videos FAQs YouTube

roadmap.sh by @kamrify

Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.

© roadmap.sh · Terms · Privacy · Advertise ·

ThewNewStack

The top DevOps resource for Kubernetes, cloud-native computing, and large-scale development and deployment.