Deploy Debug Modal #4
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 Debug Modal | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # ── Setup ──────────────────────────────────────────────── | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # ── Build ──────────────────────────────────────────────── | |
| - name: Build debug modal script | |
| run: pnpm bundle:debug | |
| # ── Unit tests ────────────────────────────────────────── | |
| - name: Run modal unit tests | |
| run: pnpm test:units:modal | |
| # ── Deploy to Cloudflare R2 ───────────────────────────── | |
| - name: Upload stonks-debug.js to R2 (master) | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| export CLOUDFLARE_API_TOKEN=$(printf '%s' "$CLOUDFLARE_API_TOKEN" | tr -d '\n\r') | |
| npx wrangler r2 object put one-dollar-analytic/stonks-debug.js --file=build/stonks-debug.js --content-type=text/javascript --remote | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| - name: Upload stonks-debug-dev.js to R2 (dev) | |
| if: github.ref == 'refs/heads/dev' | |
| run: | | |
| export CLOUDFLARE_API_TOKEN=$(printf '%s' "$CLOUDFLARE_API_TOKEN" | tr -d '\n\r') | |
| npx wrangler r2 object put one-dollar-analytic/stonks-debug-dev.js --file=build/stonks-debug.js --content-type=text/javascript --remote | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |