All checks were successful
Publish ParaWiki / build-and-deploy (push) Successful in 32s
긴 한국어 제목 구분성 향상을 위해 각 항목에 좌측 색상 띠와 점선 구분선 추가. 빌드 시 quartz-custom/custom.scss가 Quartz 기본 custom.scss를 덮어씀. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
75 lines
2.2 KiB
YAML
75 lines
2.2 KiB
YAML
name: Publish ParaWiki
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'wiki/**'
|
|
- '.gitea/workflows/publish.yml'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout ParaWiki
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: parawiki
|
|
|
|
- name: Clone Quartz
|
|
run: git clone --depth 1 https://github.com/jackyzha0/quartz.git quartz
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Install Quartz dependencies
|
|
working-directory: quartz
|
|
run: npm ci
|
|
|
|
- name: Patch Quartz config for ParaWiki
|
|
working-directory: quartz
|
|
run: |
|
|
node -e "
|
|
const fs = require('fs');
|
|
let c = fs.readFileSync('quartz.config.ts','utf8');
|
|
c = c.replace(/pageTitle: \".*?\"/, 'pageTitle: \"ParaWiki\"');
|
|
c = c.replace(/baseUrl: \".*?\"/, 'baseUrl: \"parawiki.pages.dev\"');
|
|
c = c.replace(/locale: \".*?\"/, 'locale: \"ko-KR\"');
|
|
fs.writeFileSync('quartz.config.ts', c);
|
|
"
|
|
|
|
- name: Copy wiki content into Quartz
|
|
run: |
|
|
rm -rf quartz/content
|
|
mkdir -p quartz/content
|
|
cp -r parawiki/wiki/. quartz/content/
|
|
rm -f quartz/content/CLAUDE.md
|
|
|
|
- name: Apply custom styles
|
|
run: |
|
|
if [ -f parawiki/quartz-custom/custom.scss ]; then
|
|
cp parawiki/quartz-custom/custom.scss quartz/quartz/styles/custom.scss
|
|
fi
|
|
|
|
- name: Build site
|
|
working-directory: quartz
|
|
run: npx quartz build
|
|
|
|
- name: Ensure Cloudflare Pages project exists
|
|
continue-on-error: true
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: pages project create parawiki --production-branch=main
|
|
|
|
- name: Deploy to Cloudflare Pages
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: pages deploy quartz/public --project-name=parawiki --branch=main --commit-dirty=true
|