feat: 完整实现 Deno Deploy 使用 shared 库 🦕 #51
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: Deploy to Cloudflare Workers | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Deploy to Production | |
| steps: | |
| - name: 📥 Checkout code | |
| uses: actions/checkout@v4 | |
| - name: 🏗️ Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - name: 🏗️ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'pnpm' | |
| - name: 📦 Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🔍 Type check | |
| run: pnpm run type-check | |
| - name: 🗄️ Apply database migrations | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| workingDirectory: packages/cloudflare | |
| command: d1 migrations apply webhook-proxy-db --remote | |
| - name: 🚀 Deploy to Cloudflare Workers | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| workingDirectory: packages/cloudflare | |
| command: deploy | |
| - name: 📝 Deployment summary | |
| run: | | |
| echo "### 🎉 部署成功!" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- **环境**: Production" >> $GITHUB_STEP_SUMMARY | |
| echo "- **分支**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **提交**: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **时间**: $(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_STEP_SUMMARY | |