diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 312baba..c54fe4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,3 +16,21 @@ jobs: node-version: 22 - run: npm install - run: npm test + + deploy: + needs: test + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm install + - name: Build UI + run: cd packages/engine/ui && npm run build && cp dist/index.html ../src/ui.html + - name: Deploy to Cloudflare Workers + run: cd packages/engine && npx wrangler deploy + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}