improved build caching
This commit is contained in:
@@ -14,15 +14,44 @@ jobs:
|
||||
submodules: true
|
||||
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
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: "latest"
|
||||
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
|
||||
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
|
||||
run: sudo apt-get update && sudo apt-get install -y rsync
|
||||
|
||||
|
||||
Reference in New Issue
Block a user