Merge pull request #23 from sh1ma/renovate/hono-zod-validator-0.x #95
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: Register Articles to D1 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Deploy | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Run Migration | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: d1 migrations apply blog-iine-counter | |
| - name: Make Register Query | |
| run: | | |
| QUERY="" | |
| FILENAMES=$(for file in src/markdown/posts/*.md;do if [ -f "$file" ]; then base=$(basename "$file" .md); echo $base; fi;done) | |
| for filename in $FILENAMES; do | |
| QUERY="$QUERY INSERT OR IGNORE INTO articles (id) VALUES ('$filename');"; | |
| done | |
| echo "query=$QUERY" >> $GITHUB_ENV | |
| - name: Register Articles to D1 | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: d1 execute blog-iine-counter --remote --command "${{ env.query }}" | |
| packageManager: pnpm |