chore: format #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [main] | |
paths: | |
- 'books/zh-CN/**/*.md' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
sync-to-ao3: | |
runs-on: ubuntu-latest | |
environment: | |
name: ao3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.6.0 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm i --frozen-lockfile | |
- name: Cache node_modules based on Markdown files | |
uses: actions/cache@v2 | |
with: | |
path: | | |
node_modules/.cache | |
key: ${{ runner.os }}-nodecache-${{ hashFiles('books/zh-CN/**/*.md') }} | |
restore-keys: | | |
${{ runner.os }}-nodecache- | |
- name: Publish to Ao3 | |
run: | | |
echo "Publishing to Ao3, env: $AO3_COOKIE" | |
pnpm mark-magic --task publishToAo3 | |
env: | |
AO3_COOKIE: ${{ secrets.AO3_COOKIE }} |