diff --git a/.github/workflows/deploy-worker.yml b/.github/workflows/deploy-worker.yml new file mode 100644 index 0000000..042606a --- /dev/null +++ b/.github/workflows/deploy-worker.yml @@ -0,0 +1,32 @@ +name: Deploy Worker + +on: + push: + branches: + - main # or 'production' depending on your branch name + +jobs: + deploy: + runs-on: ubuntu-latest + name: Deploy Worker + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - name: Install Dependencies + run: npm ci + working-directory: ./worker + + - name: Deploy to Cloudflare Workers + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + workingDirectory: "worker" + command: deploy + env: + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}