mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
78 lines
2.0 KiB
YAML
78 lines
2.0 KiB
YAML
name: 'Build'
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
name: Build (Hugo ${{ matrix.hugo-label }})
|
|
if: github.event.repository.fork == false
|
|
strategy:
|
|
matrix:
|
|
hugo-version: ['latest', '0.114.0']
|
|
include:
|
|
- hugo-version: latest
|
|
hugo-label: Latest
|
|
- hugo-version: '0.114.0'
|
|
hugo-label: 'v0.114.0'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
token: ${{ secrets.PAT }}
|
|
|
|
- name: Setup Mise
|
|
uses: jdx/mise-action@v3
|
|
with:
|
|
install_args: node@latest pnpm@10 hugo-extended@${{ matrix.hugo-version }}
|
|
tool_versions: |
|
|
node latest
|
|
pnpm 10
|
|
hugo-extended ${{ matrix.hugo-version }}
|
|
cache: true
|
|
|
|
- name: Get pnpm store path
|
|
id: pnpm-cache
|
|
run: 'echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT'
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
key: pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
pnpm-store-
|
|
|
|
- name: Setup Hugo cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: exampleSite/resources/_gen
|
|
key: hugo-${{ matrix.hugo-version }}-${{ hashFiles('./exampleSite/**/*.jpg') }}
|
|
restore-keys: |
|
|
hugo-${{ matrix.hugo-version }}-
|
|
|
|
- name: Install project dependencies
|
|
run: 'pnpm install'
|
|
|
|
- name: Build
|
|
run: 'pnpm run build'
|
|
|
|
- name: Commit
|
|
if: >
|
|
matrix.hugo-version == 'latest' &&
|
|
(github.event_name == 'push' || github.event.pull_request.merged == true)
|
|
uses: stefanzweifel/git-auto-commit-action@v7
|
|
with:
|
|
file_pattern: 'bundled/**/*.js bundled/**/*.css'
|
|
commit_message: 'ci: update bundled artifacts [skip ci]'
|