Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chabad360/hugo-gh-pages
π Build and Publish Your Hugo Site to GitHub Pages π
https://github.com/chabad360/hugo-gh-pages
actions github-pages hugo workflow
Last synced: 3 months ago
JSON representation
π Build and Publish Your Hugo Site to GitHub Pages π
- Host: GitHub
- URL: https://github.com/chabad360/hugo-gh-pages
- Owner: chabad360
- License: mit
- Created: 2019-10-13T20:39:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-08T05:34:55.000Z (over 2 years ago)
- Last Synced: 2024-10-28T15:04:21.261Z (3 months ago)
- Topics: actions, github-pages, hugo, workflow
- Language: Shell
- Homepage:
- Size: 93.8 KB
- Stars: 43
- Watchers: 3
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Image Credit: Peaceiris
Build and Publish Your Hugo Site to GitHub Pages
gohugoio/hugo: The worldβs fastest framework for building websites
π
π
ΒThis action builds your Hugo Site (using the latest Hugo Extended) and pushes it to Github Pages.
This action also contains support for several external Hugo Helpers:
| Name | Support |
| ---- | :-----: |
| reStructuredText |οΈ βοΈ |
| Pandoc | βοΈ |
| Asciidoctor | βοΈ |
| PostCSS | βοΈ |
| Pygments | βοΈ |
| Babel | βοΈ |
| Hugo Modules | βοΈ |If your site requires the use of another external helper, submit an issue and I'll try to add it.
This action is based on the Docker Image from [chabad360/hugo-actions](https://github.com/chabad360/hugo-actions).
If you need to do post-build/pre-upload steps, use that action.## β Getting started
This is a basic `workflow.yml` to get you started (for more information scroll down to [β Inputs](#-inputs)):
```yaml
name: Publish Siteon:
push:
branches:
- masterjobs:
build-deploy:
runs-on: ubuntu-lateststeps:
- name: Checkout Repo
uses: actions/checkout@master
with:
submodules: true
- name: Publish Site
uses: chabad360/hugo-gh-pages@master
with:
githubToken: ${{ secrets.PERSONAL_TOKEN }}
```### β Inputs
| Key | Description | Required | Default |
| --- | ------------ | :------: | ------- |
| `githubToken` | A Github Personal Access Token with repo permissions. | βοΈ | N/A |
| `cname` | The custom domain name for your GH Pages Site. | β | N/A |
| `branch` | The branch to push the built site to. | β | `gh-pages`|
| `repo` | The repository to push the built site to. | β | The current repo |
| `hugoVersion` | The version Hugo to use (append `extended_` to the begining to use the extended version). | β | Latest Hugo Extended |
| `args` | Arguments to pass to Hugo | β | `--gc --minify --cleanDestinationDir`|
| `siteDir` | Directory that your site is stored in. | β | `/github/workspace`|#### Usage
```yaml
- name: Publish Site
uses: chabad360/hugo-gh-pages@master
with:
githubToken: ${{ secrets.PERSONAL_TOKEN }}
# Remember to set this as a secret (i.e. secrets.PERSONAL_TOKEN).
# Don't forget to set the secret value in the project settings.
cname: mysite.com # Or anything else
# Use if you have a custom domain for your site.
branch: master # Or anything else
# Use if your site is not hosted on the gh-pages branch.
repo: you/you.github.io
# Use if you're pushing to a different repo.
# Dont add ".git" to the end of the URL (youl'll get 404s).
hugoVersion: extended_0.58.3
# Use if your site requires a specific version of Hugo.
# Append "extended_" to the begining to use Hugo Extended.
args: --gc --minify --cleanDestinationDir
# Use if you want to pass some custom arguments to Hugo.
siteDir: /github/workspace/site
# Use this if your site isn't in the root of your repo.
# The root of your repo can be found at /github/workspace
```## β Credit
This project is based on [mattbailey/actions-hugo](https://github.com/mattbailey/actions-hugo)