Closed HTMHell closed 3 months ago
Hmm, did you check out your repo as the first step of your gh action?
Doesn't look like it is finding your worker at ./supabase/functions/cloudflare/worker.ts
for whatever the cwd happens to be
Here is a public example action I have that might be helpful, note the checkout step and the path in the deploy.sh: https://github.com/skymethod/op3/blob/master/.github/workflows/deploy-on-push.yml
@johnspurlock-skymethod Thank you for your reply. I do a checkout as a first step, I also tried to run the deployment script as a step after:
name: Deploy to Production
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.PRODUCTION_DB_PASSWORD }}
PROJECT_ID: foobar
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment variables
run: |
echo "SUPABASE_DB_URL=postgres://postgres.${PROJECT_ID}:${SUPABASE_DB_PASSWORD}@aws-0-eu-central-1.pooler.supabase.com:5432/postgres" >> $GITHUB_ENV
- name: ☁️ Deploy Cloudflare Worker
run: ./deploy_cf.sh
env:
CF_SCRIPT_NAME: index
CF_CUSTOM_DOMAIN: mydomain.com
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
... # other steps
I also tried running the script with a wrong path, and I get a different error mesasge:
error: Uncaught (in promise) Error: Bad scriptSpec: not a valid script name or file path or https url: ./supabase/functions/cloudflare/testworker.ts
throw new Error(`Bad scriptSpec: not a valid script name or file path or https url: ${scriptSpec}`);
Also, I don't have any uncommitted files, and the repository is up to date
That's strange. Maybe add the --verbose
flag to your denoflare push
command and see if there are any clues?
The fact that it says your bundled module JS is zero bytes is a clue
putting module-based worker index... (0bytes) (20bytes compressed)
maybe run deno bundle
on your module entry point locally and see what comes out. That's effectively what push
does to bundle your worker.
When I run it locally, it works. When I run it via Github Actions (ubuntu-latest), I get the following error:
This is the script I run:
My worker.ts:
Any help would be appreciated.