Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update cache usage #636

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<img width="400" alt="GitHub Actions for Hugo" src="./images/ogp.svg">

[![Project status: active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![license](https://img.shields.io/github/license/peaceiris/actions-hugo.svg)](https://github.com/peaceiris/actions-hugo/blob/main/LICENSE)
[![release](https://img.shields.io/github/release/peaceiris/actions-hugo.svg)](https://github.com/peaceiris/actions-hugo/releases/latest)
[![GitHub release date](https://img.shields.io/github/release-date/peaceiris/actions-hugo.svg)](https://github.com/peaceiris/actions-hugo/releases)
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.110.0'
hugo-version: '0.117.0'
# extended: true

- name: Build
Expand Down Expand Up @@ -122,7 +123,7 @@ Set `extended: true` to use a Hugo extended version.
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.110.0'
hugo-version: '0.117.0'
extended: true
```

Expand Down Expand Up @@ -153,9 +154,10 @@ 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
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache
path: /home/runner/.cache/hugo_cache # <-- with hugo version v0.116.0 and above
# path: /tmp/hugo_cache # <-- with hugo version < v0.116.0
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
Expand All @@ -175,7 +177,7 @@ How to sync a Hugo version between a Docker Compose and a GitHub Actions workflo
Write a `HUGO_VERSION` to the `.env` file like the following and push it to a remote branch.

```sh
HUGO_VERSION=0.110.0
HUGO_VERSION=0.117.0
```

Next, add a step to read a Hugo version from the `.env` file.
Expand Down Expand Up @@ -256,7 +258,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.110.0'
hugo-version: '0.117.0'
extended: true

- name: Setup Node
Expand Down Expand Up @@ -311,7 +313,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.110.0'
hugo-version: '0.117.0'
extended: true

- name: Setup Ruby
Expand Down Expand Up @@ -365,7 +367,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.110.0'
hugo-version: '0.117.0'
```

<div align="right">
Expand Down