diff --git a/.github/actions/setup-hugo/action.yml b/.github/actions/setup-hugo/action.yml index aa3eef7df..d4733c9e0 100644 --- a/.github/actions/setup-hugo/action.yml +++ b/.github/actions/setup-hugo/action.yml @@ -23,6 +23,8 @@ runs: extended: true - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest - name: Cache Bun dependencies uses: actions/cache@v5 diff --git a/.github/workflows/_hugo.yml b/.github/workflows/_hugo.yml index bd270802e..213e657b3 100644 --- a/.github/workflows/_hugo.yml +++ b/.github/workflows/_hugo.yml @@ -5,7 +5,6 @@ on: env: HUGO_ENVIRONMENT: production - HUGO_CACHEDIR: /tmp/hugo_cache jobs: @@ -42,7 +41,9 @@ jobs: ${{ runner.os }}-deps- - uses: oven-sh/setup-bun@v2 - - run: bun install + with: + bun-version: latest + - run: bun install --frozen-lockfile # Use Bun as the "node" runtime for Hugo's PostCSS pipeline. # Hugo 0.161+ runs Node tools with --permission flags; Bun ignores @@ -54,30 +55,23 @@ jobs: ln -sf "$(which bun)" "$HOME/.bun-as-node/node" echo "$HOME/.bun-as-node" >> "$GITHUB_PATH" - # Tier 2: Hugo build cache (changes with any build-affecting file) + # Tier 2a: Hugo image cache (survives CSS/HTML changes) - uses: actions/cache@v5 - name: Cache Hugo build resources + name: Cache Hugo processed images with: - path: | - ${{ env.HUGO_CACHEDIR }} - resources/_gen - key: ${{ runner.os }}-hugo-build-${{ hashFiles('hugo.toml', 'hugo.dev.toml', 'postcss.config.js', 'package.json', 'themes/**', 'layouts/**') }} + path: resources/_gen/images + key: ${{ runner.os }}-hugo-images-${{ hashFiles('assets/**', 'content/**/*.jpg', 'content/**/*.jpeg', 'content/**/*.png', 'content/**/*.webp', 'content/**/*.gif', 'content/**/*.svg', 'static/**', 'themes/**/static/**', 'themes/**/assets/images/**') }} restore-keys: | - ${{ runner.os }}-hugo-build- - ${{ runner.os }}-hugo- + ${{ runner.os }}-hugo-images- - # Tier 3: Content and template cache (comprehensive file tracking) + # Tier 2b: Hugo asset cache (CSS/JS compilation, updates on theme/config changes) - uses: actions/cache@v5 - name: Cache Hugo content and assets + name: Cache Hugo asset compilation with: - path: | - public - hugo_stats.json - key: ${{ runner.os }}-hugo-content-${{ hashFiles('content/**', 'data/**', 'assets/**', 'static/**', 'layouts/**', 'themes/**/*.html', 'themes/**/*.scss', 'themes/**/*.js', 'hugo.toml', 'hugo.dev.toml', 'postcss.config.js') }} + path: resources/_gen/assets + key: ${{ runner.os }}-hugo-assets-${{ hashFiles('themes/**', 'layouts/**', 'postcss.config.js', 'package.json', 'hugo.toml', 'hugo.dev.toml') }} restore-keys: | - ${{ runner.os }}-hugo-content-${{ hashFiles('content/**', 'data/**', 'assets/**', 'static/**') }} - ${{ runner.os }}-hugo-content-${{ hashFiles('content/**', 'data/**') }} - ${{ runner.os }}-hugo-content- + ${{ runner.os }}-hugo-assets- - name: Build with Hugo run: | diff --git a/bun.lockb b/bun.lockb index ddf0b4e7f..f9e39909d 100755 Binary files a/bun.lockb and b/bun.lockb differ