How to Deploy Your Static Website with GitHub Actions: 1-Min Guide

Deploying a static website manually every time there’s an update can feel tedious.

With GitHub Actions, you can automate the entire process, so your site goes live on GitHub Pages with every push to your configured branch.

In this tutorial, let’s walk through how to set up automatic deployments for your static website using GitHub Actions, saving you time and effort.

How to Deploy Your Static Website with GitHub Actions

Steps to follow:

1. Navigate to the 'Settings' section of your repository on GitHub.

2. Scroll down to the GitHub 'Pages' section.

3. Choose the branch you wish to deploy from (e.g., main).

4. Select the branch from the drop-down menu.

5. Save the changes.

6. Once the action completes, you can access your deployed website at 'https://<your-username>.github.io/<repository-name>'.

Click the 'Visit site' button to view it.

Notes:

  • Deployment may take a few moments to complete.
  • Every time you push changes to the main branch (or your configured branch), GitHub Actions will automatically redeploy your site to GitHub Pages.

That's all!

We have successfully deployed a static website to GitHub Pages using GitHub Actions!

Conclusion

Setting up automated deployments with GitHub Actions means you can focus on improving your site without worrying about the deployment process.

Now, each update you push is seamlessly deployed to GitHub Pages, keeping everything live and in sync.

Still have questions?

Send an email to archana@leadwalnut.com, OR

Book a FREE consultation with an expert developer here.