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 Cloudflare Worker | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' # This tells the setup-node action to cache npm dependencies | |
- name: Install dependencies | |
run: npm install @nx/nx-linux-x64-gnu && npm ci --include=optional | |
- name: Build Worker | |
run: npm run build:worker | |
- name: Install Wrangler | |
run: npm install -g @cloudflare/wrangler | |
- uses: actions/checkout@v3 | |
- name: Deploy | |
# run npx wrangler publish | |
run: CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }} cd packages/worker && npm install && npx wrangler deploy |