34 lines
712 B
YAML
34 lines
712 B
YAML
name: Deploy to Cloudflare Workers
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Build app
|
|
run: npm run build
|
|
|
|
- name: Deploy to Cloudflare Workers
|
|
run: npx wrangler deploy --minify
|
|
env:
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|