mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2025-05-04 14:25:30 +08:00
docs: Add Caching Hugo Modules
This commit is contained in:
parent
4245d14847
commit
18a809e6c9
18
README.md
18
README.md
@ -47,6 +47,7 @@ Thanks to this change, we can complete this action in less than a few seconds.
|
|||||||
- [⭐️ Use Hugo extended](#%EF%B8%8F-use-hugo-extended)
|
- [⭐️ Use Hugo extended](#%EF%B8%8F-use-hugo-extended)
|
||||||
- [⭐️ Use the latest version of Hugo](#%EF%B8%8F-use-the-latest-version-of-hugo)
|
- [⭐️ Use the latest version of Hugo](#%EF%B8%8F-use-the-latest-version-of-hugo)
|
||||||
- [Tips](#tips)
|
- [Tips](#tips)
|
||||||
|
- [⭐️ Caching Hugo Modules](#%EF%B8%8F-caching-hugo-modules)
|
||||||
- [⭐️ Read Hugo version from file](#%EF%B8%8F-read-hugo-version-from-file)
|
- [⭐️ Read Hugo version from file](#%EF%B8%8F-read-hugo-version-from-file)
|
||||||
- [⭐️ Workflow for autoprefixer and postcss-cli](#%EF%B8%8F-workflow-for-autoprefixer-and-postcss-cli)
|
- [⭐️ Workflow for autoprefixer and postcss-cli](#%EF%B8%8F-workflow-for-autoprefixer-and-postcss-cli)
|
||||||
- [⭐️ Workflow for asciidoctor](#%EF%B8%8F-workflow-for-asciidoctor)
|
- [⭐️ Workflow for asciidoctor](#%EF%B8%8F-workflow-for-asciidoctor)
|
||||||
@ -144,6 +145,23 @@ This action fetches the latest version of Hugo by [hugo | Homebrew Formulae](htt
|
|||||||
|
|
||||||
## Tips
|
## Tips
|
||||||
|
|
||||||
|
### ⭐️ Caching Hugo Modules
|
||||||
|
|
||||||
|
Insert a cache step before site-building as follows.
|
||||||
|
Note that the cache dir location of Hugo on a Linux-based operating system is `/tmp/hugo_cache`. On macOS, `${TMPDIR}/hugo_cache` has the location.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/hugo_cache
|
||||||
|
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-hugomod-
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: hugo --minify
|
||||||
|
```
|
||||||
|
|
||||||
### ⭐️ Read Hugo version from file
|
### ⭐️ Read Hugo version from file
|
||||||
|
|
||||||
How to sync a Hugo version between a Docker Compose and a GitHub Actions workflow via `.env` file.
|
How to sync a Hugo version between a Docker Compose and a GitHub Actions workflow via `.env` file.
|
||||||
|
Loading…
Reference in New Issue
Block a user