mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2025-05-04 14:25:30 +08:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3a287949d3 | ||
![]() |
3b443076f0 | ||
![]() |
764796d276 | ||
![]() |
e177dc33cb | ||
![]() |
711df4ed64 | ||
![]() |
9d57878417 | ||
![]() |
288264f9c9 | ||
![]() |
7db63f5e7f | ||
![]() |
00e5abe1c8 | ||
![]() |
1b06a03d21 |
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@ -13,12 +13,12 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
2
.github/workflows/dependency-review.yml
vendored
2
.github/workflows/dependency-review.yml
vendored
@ -13,4 +13,4 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/dependency-review-action@v3
|
||||
- uses: actions/dependency-review-action@v4
|
||||
|
2
.github/workflows/test-action.yml
vendored
2
.github/workflows/test-action.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2.6.0
|
||||
uses: peaceiris/actions-hugo@v3.0.0
|
||||
with:
|
||||
hugo-version: ${{ matrix.hugo-version }}
|
||||
extended: ${{ matrix.extended }}
|
||||
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -47,9 +47,9 @@ jobs:
|
||||
- run: npm test
|
||||
|
||||
- name: Upload test coverage as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-${{ matrix.os }}
|
||||
path: coverage
|
||||
|
||||
- uses: codecov/codecov-action@v3
|
||||
- uses: codecov/codecov-action@v5
|
||||
|
36
README.md
36
README.md
@ -91,7 +91,7 @@ jobs:
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
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@v2
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
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@v2
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
```
|
||||
@ -151,13 +151,27 @@ 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.
|
||||
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.
|
||||
|
||||
First, to maximize compatibility with all Hugo versions, let's define the variable `HUGO_CACHEDIR`:
|
||||
|
||||
```yaml
|
||||
- uses: actions/cache@v3
|
||||
# * ...
|
||||
|
||||
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
|
||||
with:
|
||||
path: /home/runner/.cache/hugo_cache # <-- with hugo version v0.116.0 and above
|
||||
# path: /tmp/hugo_cache # <-- with hugo version < v0.116.0
|
||||
path: ${{ env.HUGO_CACHEDIR }} # <- Use the same env variable just right here
|
||||
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-hugomod-
|
||||
@ -190,7 +204,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@v2
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}'
|
||||
extended: true
|
||||
@ -256,7 +270,7 @@ jobs:
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: '0.119.0'
|
||||
extended: true
|
||||
@ -310,7 +324,7 @@ jobs:
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: '0.119.0'
|
||||
extended: true
|
||||
@ -364,7 +378,7 @@ jobs:
|
||||
run: git config core.quotePath false
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: '0.119.0'
|
||||
```
|
||||
|
11717
lib/index.js
11717
lib/index.js
File diff suppressed because one or more lines are too long
2
package-lock.json
generated
2
package-lock.json
generated
@ -6,7 +6,7 @@
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "actions-hugo",
|
||||
"version": "2.6.0",
|
||||
"version": "3.0.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
Loading…
Reference in New Issue
Block a user