Always return JSON as output for functions #3
This file contains 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 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 |