Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reuixiy/hugo-deploy
Deploy your Hugo site to GitHub Pages, via GitHub Actions, with Arch Linux.
https://github.com/reuixiy/hugo-deploy
github-actions hugo
Last synced: 3 months ago
JSON representation
Deploy your Hugo site to GitHub Pages, via GitHub Actions, with Arch Linux.
- Host: GitHub
- URL: https://github.com/reuixiy/hugo-deploy
- Owner: reuixiy
- Created: 2020-08-15T13:51:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-15T15:32:32.000Z (about 2 years ago)
- Last Synced: 2024-10-12T22:29:16.968Z (4 months ago)
- Topics: github-actions, hugo
- Language: Shell
- Homepage: https://io-oi.me/tech/deploy-hugo-to-github-pages-via-github-actions
- Size: 4.88 KB
- Stars: 21
- Watchers: 2
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hugo-deploy
Deploy your Hugo site to GitHub Pages, via GitHub Actions, with Arch Linux.
## Prerequisites
- Git your Hugo site
## Usage
1. Generate SSH public/private key pair
```sh
ssh-keygen -t rsa -b 4096 -C "[email protected]"
```2. Add deploy key to GitHub Pages repository
Copy the generated `id_rsa.pub` to your clipboard, then add it to your *GitHub Pages* repository.
**Note that** the "Allow write access" *must* be checked.
See https://docs.github.com/en/developers/overview/managing-deploy-keys#setup-23. Add secret key to the source code repository
Copy the generated `id_rsa` to your clipboard, then add it to the *source code* repository.
**Note that** the `Name` *must* be `DEPLOY_KEY`.See https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository
4. Add workflow
Refer to the example workflow below.
5. Commit and push changes
## Example workflow
```yml
# .github/workflows/build.ymlname: build
on:
push:
branches:
- masterjobs:
build:
runs-on: ubuntu-lateststeps:
- name: 'Building...'
uses: reuixiy/hugo-deploy@v1
env:
DEPLOY_REPO: username/username.github.io
DEPLOY_BRANCH: build
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ: Asia/Shanghai
```## Additional Notes
- With Arch Linux, hugo-deploy will always use the latest extended version of Hugo, [check it here](https://www.archlinux.org/packages/community/x86_64/hugo/).
- In order to ensure the cleanliness of the GitHub Pages repository, hugo-deploy won't keep the commits history of `DEPLOY_BRANCH`, which means there is always only one commit in that branch.
- Example badge: `[![GitHub Actions](https://github.com/reuixiy/io-oi.me/workflows/build/badge.svg)](https://github.com/reuixiy/io-oi.me/actions)`
- If the source code is on GitHub Pages repository, then the step 2 and step 3 are in the same repository.
- If the `DEPLOY_BRANCH` is `build`, you may need to [choose a publishing source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source) for your GitHub Pages *after* the first build.
- If you want to [add a custom domain for your GitHub Pages site](https://docs.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site#configuring-an-apex-domain), you may need to add a `static/CNAME` file to your Hugo site, with your domain name in it.
- [Enforcing HTTPS for your GitHub Pages site](https://docs.github.com/en/github/working-with-github-pages/securing-your-github-pages-site-with-https#enforcing-https-for-your-github-pages-site).## Acknowledgements