mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
Merge pull request #581 from Sped0n/update-ci
ci: migrate workflows to mise-action and update actions
This commit is contained in:
84
.github/workflows/build.yml
vendored
84
.github/workflows/build.yml
vendored
@@ -12,34 +12,11 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
filter:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Filter
|
|
||||||
outputs:
|
|
||||||
any_changed: ${{ steps.changed-files-specific.outputs.any_changed }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Get changed files in scope
|
|
||||||
id: changed-files-specific
|
|
||||||
uses: tj-actions/changed-files@v47
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
package.json
|
|
||||||
pnpm-lock.yaml
|
|
||||||
tsconfig.json
|
|
||||||
vite.config.ts
|
|
||||||
assets/**
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Build (Hugo ${{ matrix.hugo-label }})
|
name: Build (Hugo ${{ matrix.hugo-label }})
|
||||||
needs: [filter]
|
if: github.event.repository.fork == false
|
||||||
if: |
|
|
||||||
github.event.repository.fork == false
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
hugo-version: ['latest', '0.114.0']
|
hugo-version: ['latest', '0.114.0']
|
||||||
@@ -49,59 +26,52 @@ jobs:
|
|||||||
- hugo-version: '0.114.0'
|
- hugo-version: '0.114.0'
|
||||||
hugo-label: 'v0.114.0'
|
hugo-label: 'v0.114.0'
|
||||||
steps:
|
steps:
|
||||||
- name: Set current date as env variable
|
|
||||||
run: |
|
|
||||||
echo "builddate=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Mise
|
||||||
uses: peaceiris/actions-hugo@v2.6.0
|
uses: jdx/mise-action@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: ${{ matrix.hugo-version }}
|
install_args: node@latest pnpm@10 hugo-extended@${{ matrix.hugo-version }}
|
||||||
extended: true
|
tool_versions: |
|
||||||
|
node latest
|
||||||
|
pnpm 10
|
||||||
|
hugo-extended ${{ matrix.hugo-version }}
|
||||||
|
cache: true
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Get pnpm store path
|
||||||
uses: pnpm/action-setup@v3
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
id: pnpm-cache
|
||||||
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
run: 'echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT'
|
||||||
|
|
||||||
- name: Setup pnpm cache
|
- name: Setup pnpm cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
|
key: pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pnpm-store-
|
pnpm-store-
|
||||||
|
|
||||||
- name: Setup hugo cache
|
- name: Setup Hugo cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: ./exampleSite/resources
|
path: exampleSite/resources/_gen
|
||||||
key: ${{ runner.os }}-hugo-${{ matrix.hugo-version }}-${{ hashFiles('./exampleSite') }}
|
key: hugo-${{ matrix.hugo-version }}-${{ hashFiles('./exampleSite/**/*.jpg') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-hugo-${{ matrix.hugo-version }}-
|
hugo-${{ matrix.hugo-version }}-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install project dependencies
|
||||||
run: pnpm install
|
run: 'pnpm install'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: 'pnpm run build'
|
||||||
pnpm run build
|
|
||||||
|
|
||||||
- name: Push artifacts
|
- name: Commit
|
||||||
if: >
|
if: >
|
||||||
matrix.hugo-version == 'latest' &&
|
matrix.hugo-version == 'latest' &&
|
||||||
(github.event_name == 'push' || github.event.pull_request.merged == true) &&
|
(github.event_name == 'push' || github.event.pull_request.merged == true)
|
||||||
needs.filter.outputs.any_changed == 'true'
|
uses: stefanzweifel/git-auto-commit-action@v7
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
|
||||||
with:
|
with:
|
||||||
|
file_pattern: 'bundled/**/*.js bundled/**/*.css'
|
||||||
commit_message: 'ci: update bundled artifacts [skip ci]'
|
commit_message: 'ci: update bundled artifacts [skip ci]'
|
||||||
|
|||||||
57
.github/workflows/eslint.yml
vendored
57
.github/workflows/eslint.yml
vendored
@@ -1,57 +0,0 @@
|
|||||||
name: 'ESLint && Prettier'
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Lint
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.PAT || github.token }}
|
|
||||||
|
|
||||||
- name: Setup pnpm
|
|
||||||
uses: pnpm/action-setup@v3
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Setup pnpm cache
|
|
||||||
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-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Lint Check
|
|
||||||
continue-on-error: true
|
|
||||||
id: check
|
|
||||||
run: pnpm run lint:check
|
|
||||||
|
|
||||||
- name: Format manually
|
|
||||||
id: format
|
|
||||||
if: ${{ steps.check.outcome == 'failure' }}
|
|
||||||
run: pnpm run lint
|
|
||||||
|
|
||||||
- name: Commit
|
|
||||||
if: ${{ steps.format.outcome == 'success' }}
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
|
||||||
with:
|
|
||||||
commit_message: 'ci: format code [skip ci]'
|
|
||||||
58
.github/workflows/lint.yml
vendored
Normal file
58
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
name: 'Lint'
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Lint
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
# github.token as a fallback, since other user might trigger this
|
||||||
|
# workflow in their pull request
|
||||||
|
token: ${{ secrets.PAT || github.token }}
|
||||||
|
|
||||||
|
- name: Setup Mise
|
||||||
|
uses: jdx/mise-action@v3
|
||||||
|
with:
|
||||||
|
install_args: node@latest pnpm@10
|
||||||
|
tool_versions: |
|
||||||
|
node latest
|
||||||
|
pnpm 10
|
||||||
|
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: Install project dependencies
|
||||||
|
run: 'pnpm install'
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
id: lint
|
||||||
|
run: 'pnpm run lint:check || pnpm run lint'
|
||||||
|
|
||||||
|
- name: Commit
|
||||||
|
if: ${{ steps.format.lint == 'success' }}
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v7
|
||||||
|
with:
|
||||||
|
commit_message: 'ci: lint [skip ci]'
|
||||||
Reference in New Issue
Block a user