description: Deploy Hugo as a GitHub Pages project or personal/organizational site and automate the whole process with Github Actions
categories: [hosting and deployment]
keywords: [github,git,deployment,hosting]
menu:
docs:
parent: hosting-and-deployment
toc: true
aliases: [/tutorials/github-pages-blog/]
---
GitHub provides free and fast static hosting over SSL for personal, organization, or project pages directly from a GitHub repository via its GitHub Pages service and automating development workflows and build with GitHub Actions.
## Prerequisites
1. [Create a GitHub account]
2. [Install Git]
3. [Create a Hugo site] and test it locally with `hugo server`.
[Create a GitHub account]: https://github.com/signup
[Create a Hugo site]: /getting-started/quick-start/
## Types of sites
There are three types of GitHub Pages sites: project, user, and organization. Project sites are connected to a specific project hosted on GitHub. User and organization sites are connected to a specific account on GitHub.com.
{{% note %}}
See the [GitHub Pages documentation] to understand the requirements for repository ownership and naming.
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
{{</code>}}
Step 7
: Commit the change to your local repository with a commit message of something like "Add workflow", and push to GitHub.
Step 8
: From GitHub's main menu, choose **Actions**. You will see something like this:
![screen capture](gh-pages-3.png)
{style="max-width: 350px"}
Step 9
: When GitHub has finished building and deploying your site, the color of the status indicator will change to green.
![screen capture](gh-pages-4.png)
{style="max-width: 350px"}
Step 10
: Click on the commit message as shown above. You will see this:
![screen capture](gh-pages-5.png)
{style="max-width: 611px"}
Under the deploy step, you will see a link to your live site.
In the future, whenever you push a change from your local repository, GitHub will rebuild your site and deploy the changes.
## Additional resources
- [Learn more about GitHub Actions](https://docs.github.com/en/actions)
- [Caching dependencies to speed up workflows](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows)
- [Manage a custom domain for your GitHub Pages site](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages)