All checks were successful
Publish ParaWiki / build-and-deploy (push) Successful in 33s
첫 배포 시 프로젝트가 없어서 실패했던 문제 수정. 배포 전에 project create를 시도하고, 이미 존재하면 continue-on-error로 통과. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
69 lines
2.0 KiB
YAML
69 lines
2.0 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: 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
|