mirror of
https://github.com/voson-wang/toon.git
synced 2026-01-30 07:44:10 +08:00
* ci: organize and speed up workflows Reduced `ci.yml` costs and carbon emissions by using only one `job` --- Part of the https://github.com/Cambridge-ICCS/green-ci initiative 🍃 * remove emojis * chore: update pnpm name and yaml array syntax --------- Co-authored-by: Johann Schopplich <mail@johannschopplich.com>
59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
name: Deploy Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- docs/**
|
|
- automd.config.ts
|
|
- package.json
|
|
- eslint.config.mjs
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
deploy:
|
|
name: Deploy Docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
|
|
- name: Get pnpm store directory
|
|
id: pnpm-cache
|
|
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Cache pnpm dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build docs
|
|
run: pnpm run docs:build
|
|
|
|
- name: Deploy to Cloudflare
|
|
run: cd docs && npx wrangler deploy
|
|
env:
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|