fix(actions): Build worker using nitro

This commit is contained in:
2023-09-08 23:34:36 -05:00
parent 76fc23d88a
commit 8f4c6eb857

View File

@@ -1,17 +1,46 @@
# Docs: https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler name: cloudflare
name: Deploy Worker
on: on:
push: push:
branches:
- main
pull_request: pull_request:
repository_dispatch: branches:
- main
jobs: jobs:
deploy: ci:
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os: [ ubuntu-latest ]
node: [ 14 ]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/setup-node@v1
- name: Build & Deploy Worker with:
node-version: ${{ matrix.node }}
- name: Checkout
uses: actions/checkout@master
- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn
- name: Build
run: yarn build
env:
NITRO_PRESET: cloudflare
- name: Publish to Cloudflare
uses: cloudflare/wrangler-action@2.0.0 uses: cloudflare/wrangler-action@2.0.0
with: with:
apiToken: ${{ secrets.CF_API_TOKEN }} apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}