v1.1.4 #69
Workflow file for this run
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 Cloudflare Workers | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| deploy-worker: | |
| runs-on: ubuntu-latest | |
| name: Deploy ${{ matrix.worker }} to production | |
| environment: prod | |
| strategy: | |
| matrix: | |
| worker: [downloader, uploader] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install python dependencies | |
| working-directory: ./${{ matrix.worker }} | |
| run: | | |
| uv sync | |
| - name: Upload secrets to Cloudflare (Uploader only) | |
| if: matrix.worker == 'uploader' | |
| working-directory: ./${{ matrix.worker }} | |
| run: | | |
| echo $UPLOADER_TOKEN | uv run pywrangler secret put UPLOADER_TOKEN --name uploader | |
| env: | |
| UPLOADER_TOKEN: ${{ secrets.UPLOADER_SECRET }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| - name: Deploy Worker | |
| working-directory: ./${{ matrix.worker }} | |
| run: | | |
| uv run pywrangler deploy | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| - name: Apply D1 Migrations (Downloader only) | |
| if: matrix.worker == 'downloader' | |
| working-directory: ./${{ matrix.worker }} | |
| run: | | |
| uv run pywrangler d1 migrations apply tcg-image-metadata-db --remote | |
| uv run pywrangler d1 migrations apply tcg-presets-sets-db --remote | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |