Skip to content

Always return JSON as output for functions #3

Always return JSON as output for functions

Always return JSON as output for functions #3

name: Deploy Workers
on:
push:
branches: [main]
paths: ["functions/**"]
workflow_dispatch:
jobs:
deploy-functions:
# This job deploys the functions to Cloudflare Workers
# should only be run on pushes to functions/ directory in main branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
cache-dependency-path: functions/package-lock.json
- name: Install Dependencies
working-directory: ./functions
run: |
npm ci
- name: Deploy
working-directory: ./functions
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: npm run deploy