chore: 更新文档 #6
This file contains hidden or 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: Database Migration | |
| on: | |
| workflow_dispatch: # Manual trigger | |
| push: | |
| branches: [main] | |
| jobs: | |
| migrate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Fix migration names (NuxtHub Admin compatibility) | |
| run: | | |
| pnpx wrangler d1 execute exif-gallery-nuxt --remote --command="UPDATE _hub_migrations SET name = name || '.sql' WHERE name NOT LIKE '%.sql';" | |
| env: | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| - name: Run D1 migrations | |
| run: pnpx wrangler d1 migrations apply exif-gallery-nuxt --remote | |
| env: | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} |