mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2025-05-11 03:45:27 +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
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v3
|
||||||
with:
|
with:
|
||||||
languages: javascript
|
languages: javascript
|
||||||
|
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v2
|
uses: github/codeql-action/autobuild@v3
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- 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
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2.6.0
|
uses: peaceiris/actions-hugo@v3.0.0
|
||||||
with:
|
with:
|
||||||
hugo-version: ${{ matrix.hugo-version }}
|
hugo-version: ${{ matrix.hugo-version }}
|
||||||
extended: ${{ matrix.extended }}
|
extended: ${{ matrix.extended }}
|
||||||
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -47,9 +47,9 @@ jobs:
|
|||||||
- run: npm test
|
- run: npm test
|
||||||
|
|
||||||
- name: Upload test coverage as artifact
|
- name: Upload test coverage as artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: coverage-${{ matrix.os }}
|
name: coverage-${{ matrix.os }}
|
||||||
path: coverage
|
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
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.119.0'
|
hugo-version: '0.119.0'
|
||||||
# extended: true
|
# extended: true
|
||||||
@ -121,7 +121,7 @@ Set `extended: true` to use a Hugo extended version.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.119.0'
|
hugo-version: '0.119.0'
|
||||||
extended: true
|
extended: true
|
||||||
@ -133,7 +133,7 @@ Set `hugo-version: 'latest'` to use the latest version of Hugo.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: 'latest'
|
hugo-version: 'latest'
|
||||||
```
|
```
|
||||||
@ -151,13 +151,27 @@ This action fetches the latest version of Hugo by [hugo | Homebrew Formulae](htt
|
|||||||
### ⭐️ Caching Hugo Modules
|
### ⭐️ Caching Hugo Modules
|
||||||
|
|
||||||
Insert a cache step before site-building as follows.
|
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
|
```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:
|
with:
|
||||||
path: /home/runner/.cache/hugo_cache # <-- with hugo version v0.116.0 and above
|
path: ${{ env.HUGO_CACHEDIR }} # <- Use the same env variable just right here
|
||||||
# path: /tmp/hugo_cache # <-- with hugo version < v0.116.0
|
|
||||||
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-hugomod-
|
${{ 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}"
|
echo "HUGO_VERSION=${HUGO_VERSION}" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}'
|
hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}'
|
||||||
extended: true
|
extended: true
|
||||||
@ -256,7 +270,7 @@ jobs:
|
|||||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.119.0'
|
hugo-version: '0.119.0'
|
||||||
extended: true
|
extended: true
|
||||||
@ -310,7 +324,7 @@ jobs:
|
|||||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.119.0'
|
hugo-version: '0.119.0'
|
||||||
extended: true
|
extended: true
|
||||||
@ -364,7 +378,7 @@ jobs:
|
|||||||
run: git config core.quotePath false
|
run: git config core.quotePath false
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.119.0'
|
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": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "actions-hugo",
|
"name": "actions-hugo",
|
||||||
"version": "2.6.0",
|
"version": "3.0.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
Loading…
Reference in New Issue
Block a user