docs: Add tips
This commit is contained in:
parent
e785c1922d
commit
ceab68a949
1 changed files with 38 additions and 5 deletions
43
README.md
43
README.md
|
|
@ -8,11 +8,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## GitHub Actions for Hugo extended and Modules
|
## GitHub Actions for Hugo
|
||||||
|
|
||||||
- [gohugoio/hugo: The world’s fastest framework for building websites.](https://github.com/gohugoio/hugo)
|
- [gohugoio/hugo: The world’s fastest framework for building websites.](https://github.com/gohugoio/hugo)
|
||||||
|
|
||||||
We can run Hugo on a virtual machine of GitHub Actions by this Hugo action. Hugo extended version and Hugo Modules are supported.
|
We can run **Hugo** on a virtual machine of **GitHub Actions** by this Hugo action. **Hugo extended** version and **Hugo Modules** are supported.
|
||||||
|
|
||||||
From `v2.0.0`, this Hugo action migrated to a JavaScript (TypeScript) action. We no longer build or pull a Hugo docker image. Thanks to this change, we can complete this action less than **4 sec**. (A docker base action was taking about 1 min or more execution time to build or pull.)
|
From `v2.0.0`, this Hugo action migrated to a JavaScript (TypeScript) action. We no longer build or pull a Hugo docker image. Thanks to this change, we can complete this action less than **4 sec**. (A docker base action was taking about 1 min or more execution time to build or pull.)
|
||||||
|
|
||||||
|
|
@ -24,9 +24,12 @@ From `v2.0.0`, this Hugo action migrated to a JavaScript (TypeScript) action. W
|
||||||
|---|:---:|:---:|:---:|
|
|---|:---:|:---:|:---:|
|
||||||
| Support | ✅️ | ✅️ | ✅️ |
|
| Support | ✅️ | ✅️ | ✅️ |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
*Table of Contents*
|
|
||||||
|
|
||||||
- [Getting started](#getting-started)
|
- [Getting started](#getting-started)
|
||||||
- [⭐️ Create your workflow](#%EF%B8%8F-create-your-workflow)
|
- [⭐️ Create your workflow](#%EF%B8%8F-create-your-workflow)
|
||||||
|
|
@ -72,7 +75,7 @@ jobs:
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2.2.4
|
uses: peaceiris/actions-hugo@v2.2.4
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.58.3'
|
hugo-version: '0.59.1'
|
||||||
# extended: true
|
# extended: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
@ -98,7 +101,7 @@ Set `extended: true` to use a Hugo extended version.
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2.2.4
|
uses: peaceiris/actions-hugo@v2.2.4
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.58.3'
|
hugo-version: '0.59.1'
|
||||||
extended: true
|
extended: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -117,6 +120,36 @@ This action fetches the latest version of Hugo by [hugo | Homebrew Formulae](htt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Tips
|
||||||
|
|
||||||
|
### Read Hugo version from file
|
||||||
|
|
||||||
|
How to sync a Hugo version between Docker Compose YAML file and a GitHub Actions workflow using `.env` file.
|
||||||
|
|
||||||
|
Write a `HUGO_VERSION` to the `.env` file like the following and push it to a remote branch.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
HUGO_VERSION=0.59.1
|
||||||
|
```
|
||||||
|
|
||||||
|
Next, add a step to read a Hugo version from the `.env` file.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Read .env
|
||||||
|
id: hugo-version
|
||||||
|
run: |
|
||||||
|
. ./.env
|
||||||
|
echo ::set-output name=HUGO_VERSION::${HUGO_VERSION}
|
||||||
|
|
||||||
|
- name: Setup Hugo
|
||||||
|
uses: peaceiris/actions-hugo@v2.2.4
|
||||||
|
with:
|
||||||
|
hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}'
|
||||||
|
extended: true
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
- [MIT License - peaceiris/actions-hugo]
|
- [MIT License - peaceiris/actions-hugo]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue