Closed Zer0xxxx closed 3 months ago
Oh, okay, finally found the right way to do it. Just defining the env variable and rely on it seems to be perfectly safe.
name: GitHub Pages
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.127.0
HUGO_CACHEDIR: /tmp/hugo_cache
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ env.HUGO_VERSION }}
- uses: actions/cache@v4
with:
path: ${{ env.HUGO_CACHEDIR }}
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Build
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
Looks good 👍
Hugo can define its cache directory by HUGO_CACHEDIR
env.
https://gohugo.io/getting-started/configuration/#configure-cachedir
Looks good 👍
Hugo can define its cache directory by
HUGO_CACHEDIR
env. https://gohugo.io/getting-started/configuration/#configure-cachedir
I think the documentation snippet (from the ⭐️ Caching Hugo Modules
tips section) should be updated with the HUGO_CACHEDIR
env parameter directly set to some path, in order to harmonize all of this and avoid confusion about the use of the action. What are your thoughts?
I agree! Could you open your PR to fix the section on https://github.com/peaceiris/actions-hugo?
I agree! Could you open your PR to fix the section on https://github.com/peaceiris/actions-hugo?
At your service :orange_heart:
Checklist
Describe your question
Hello!
I'm running on Hugo v0.127.0 And I'm also using a Hugo module (Blowfish).
From the docs of this GitHub Action:
But, I've checked both folders in my CI, and don't find any of them. I've even fired a ls -R /home/runner/ And a ls -R .
And I don't find any "hugo_cache"
It's weird, since I'm not using the --gc flag at the build of my Hugo website. I did everything exactly as it is documented.
Also, this is quite annoying, because the download of the module is likely 78% of the duration of my CI/CD...
Also:
And
ls /tmp
gives:There is a hugo_cache_runner here, but it seems to be pointless in this context...
Any clue?
Relevant links
Relevant log output
No response
Additional context.
No response