improved build caching
This commit is contained in:
@@ -14,15 +14,44 @@ jobs:
|
|||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# Cache Hugo dependencies and modules
|
||||||
|
- name: Cache Hugo dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /tmp/hugo_cache
|
||||||
|
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-hugo-
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v2
|
||||||
with:
|
with:
|
||||||
hugo-version: "latest"
|
hugo-version: "latest"
|
||||||
extended: true
|
extended: true
|
||||||
|
|
||||||
|
# Cache the Hugo build output
|
||||||
|
- name: Cache Hugo build
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
public
|
||||||
|
resources/_gen
|
||||||
|
key: ${{ runner.os }}-hugo-build-${{ hashFiles('content/**', 'layouts/**', 'static/**', 'themes/**', 'config/**') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-hugo-build-
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --minify --buildFuture
|
run: hugo --minify --buildFuture
|
||||||
|
|
||||||
|
# Cache apt packages
|
||||||
|
- name: Cache apt packages
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /var/cache/apt/archives
|
||||||
|
key: ${{ runner.os }}-apt-${{ hashFiles('**/deploy.yml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-apt-
|
||||||
|
|
||||||
- name: Install rsync
|
- name: Install rsync
|
||||||
run: sudo apt-get update && sudo apt-get install -y rsync
|
run: sudo apt-get update && sudo apt-get install -y rsync
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user