Fix:错误的字符 #16
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
name: Deploy | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v3 | |
# 添加 Next.js 缓存配置 | |
- name: Cache Next.js build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock', '**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-nextjs- | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Build project | |
run: | | |
bun install | |
bun run build | |
- name: Sync search index | |
run: | | |
bun run sync-search | |
env: | |
ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }} | |
- name: Add CNAME | |
run: | | |
echo "mx-space.js.org" > out/CNAME | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: out | |
env: | |
CI: true |