Skip to content

Commit

Permalink
docs: Add Caching Hugo Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Sep 30, 2020
1 parent 4245d14 commit 18a809e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 the latest version of Hugo](#%EF%B8%8F-use-the-latest-version-of-hugo)
- [Tips](#tips)
- [⭐️ Caching Hugo Modules](#%EF%B8%8F-caching-hugo-modules)
- [⭐️ 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 asciidoctor](#%EF%B8%8F-workflow-for-asciidoctor)
Expand Down Expand Up @@ -144,6 +145,23 @@ This action fetches the latest version of Hugo by [hugo | Homebrew Formulae](htt
## 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

How to sync a Hugo version between a Docker Compose and a GitHub Actions workflow via `.env` file.
Expand Down

0 comments on commit 18a809e

Please sign in to comment.