mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
ci: build with multiple Hugo versions and update caches
Add matrix strategy for 'latest' and '0.114.0' in build job. Update pnpm and Hugo cache keys for better reliability. Push artifacts only for 'latest' version. Add [skip ci] to format commit message. Signed-off-by: Sped0n <hi@sped0n.com>
This commit is contained in:
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@@ -33,11 +33,14 @@ jobs:
|
||||
build:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
name: Build
|
||||
name: Build (Hugo ${{ matrix.hugo-version }})
|
||||
needs: [filter]
|
||||
if: |
|
||||
github.ref == 'refs/heads/main' &&
|
||||
github.event.repository.fork == false
|
||||
strategy:
|
||||
matrix:
|
||||
hugo-version: ['latest', '0.114.0']
|
||||
steps:
|
||||
- name: Set current date as env variable
|
||||
run: |
|
||||
@@ -52,7 +55,7 @@ jobs:
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2.6.0
|
||||
with:
|
||||
hugo-version: '0.114.0'
|
||||
hugo-version: ${{ matrix.hugo-version }}
|
||||
extended: true
|
||||
|
||||
- name: Setup Dart Sass
|
||||
@@ -71,15 +74,17 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: ${{ runner.os }}-pnpm-store-
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Setup hugo cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./exampleSite/resources
|
||||
key: ${{ runner.os }}-hugo-${{ hashFiles('./exampleSite/resources') }}
|
||||
restore-keys: ${{ runner.os }}-hugo-
|
||||
key: ${{ runner.os }}-hugo-${{ matrix.hugo-version }}-${{ hashFiles('./exampleSite') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-hugo-${{ matrix.hugo-version }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
@@ -90,7 +95,10 @@ jobs:
|
||||
hugo --logLevel info --source=exampleSite --gc --minify
|
||||
|
||||
- name: Push artifacts
|
||||
if: ${{ (github.event_name == 'push' || github.event.pull_request.merged == true) && needs.filter.outputs.any_changed == 'true' }}
|
||||
if: >
|
||||
matrix.hugo-version == 'latest' &&
|
||||
(github.event_name == 'push' || github.event.pull_request.merged == true) &&
|
||||
needs.filter.outputs.any_changed == 'true'
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: 'ci: update bundled artifacts [skip ci]'
|
||||
|
||||
2
.github/workflows/eslint.yml
vendored
2
.github/workflows/eslint.yml
vendored
@@ -54,4 +54,4 @@ jobs:
|
||||
if: ${{ steps.format.outcome == 'success' }}
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: 'ci: format code'
|
||||
commit_message: 'ci: format code [skip ci]'
|
||||
|
||||
Reference in New Issue
Block a user