Compare commits

..

No commits in common. "main" and "v3" have entirely different histories.
main ... v3

7 changed files with 11736 additions and 33 deletions

View File

@ -13,12 +13,12 @@ jobs:
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v2
with:
languages: javascript
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v2

View File

@ -13,4 +13,4 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/dependency-review-action@v4
- uses: actions/dependency-review-action@v3

View File

@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3.0.0
uses: peaceiris/actions-hugo@v2.6.0
with:
hugo-version: ${{ matrix.hugo-version }}
extended: ${{ matrix.extended }}

View File

@ -47,9 +47,9 @@ jobs:
- run: npm test
- name: Upload test coverage as artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.os }}
path: coverage
- uses: codecov/codecov-action@v5
- uses: codecov/codecov-action@v3

View File

@ -91,7 +91,7 @@ jobs:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.119.0'
# extended: true
@ -121,7 +121,7 @@ Set `extended: true` to use a Hugo extended version.
```yaml
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.119.0'
extended: true
@ -133,7 +133,7 @@ Set `hugo-version: 'latest'` to use the latest version of Hugo.
```yaml
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
```
@ -151,27 +151,13 @@ This action fetches the latest version of Hugo by [hugo | Homebrew Formulae](htt
### ⭐️ Caching Hugo Modules
Insert a cache step before site-building as follows.
First, to maximize compatibility with all Hugo versions, let's define the variable `HUGO_CACHEDIR`:
Note that with latest hugo version, the [cache dir location](https://gohugo.io/getting-started/configuration/#configure-cachedir) on a Linux-based operating system is `${HOME}/.cache`. On macOS, `${HOME}/Library/Caches` has the location.
```yaml
# * ...
jobs:
deploy:
runs-on: ubuntu-22.04
env:
HUGO_CACHEDIR: /tmp/hugo_cache # <- Define the env variable here, so that Hugo's cache dir is now predictible in your workflow and doesn't depend on the Hugo's version you're using.
# * ...
```
Now, let's add the cache action call just above the _Build_ step:
```yaml
- uses: actions/cache@v4
- uses: actions/cache@v3
with:
path: ${{ env.HUGO_CACHEDIR }} # <- Use the same env variable just right here
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-
@ -204,7 +190,7 @@ Next, add a step to read a Hugo version from the `.env` file.
echo "HUGO_VERSION=${HUGO_VERSION}" >> "${GITHUB_OUTPUT}"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}'
extended: true
@ -270,7 +256,7 @@ jobs:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.119.0'
extended: true
@ -324,7 +310,7 @@ jobs:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.119.0'
extended: true
@ -378,7 +364,7 @@ jobs:
run: git config core.quotePath false
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.119.0'
```

11717
lib/index.js Normal file

File diff suppressed because one or more lines are too long

2
package-lock.json generated
View File

@ -6,7 +6,7 @@
"packages": {
"": {
"name": "actions-hugo",
"version": "3.0.0",
"version": "2.6.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {