cloudflare / wrangler-action

πŸ§™β€β™€οΈ easily deploy cloudflare workers applications using wrangler and github actions
Apache License 2.0
1.26k stars 159 forks source link

Example for using the action doesn't work #281

Closed svscorp closed 1 week ago

svscorp commented 3 months ago

Hi,

I am trying to deploy the code to my CF worker.

Tried (exactly as in the example):

jobs:
  deploy:
    runs-on: ubuntu-latest
    name: Deploy
    steps:
      - uses: actions/checkout@v4
      - name: Deploy app
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
jobs:
  deploy:
    runs-on: ubuntu-latest
    name: Deploy
    steps:
      - uses: actions/checkout@v4
      - name: Deploy app
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          wranglerVersion: "2.20.0"
          comand: deploy

Neither works. It fails with error: Found argument 'deploy' which wasn't expected, or isn't valid in this context, regardless whether I add command: deploy or not.

Run cloudflare/wrangler-action@v3
  with:
    apiToken: ***
    quiet: false
πŸ” Checking for existing Wrangler installation
  /usr/local/bin/npx --no-install wrangler --version
  npm error npx canceled due to missing packages and no YES option: ["wrangler@3.7[1](https://github.com/myrepo/actions/runs/10387836778/job/28762164196#step:4:1).0"]

  npm error A complete log of this run can be found in: /home/runner/.npm/_logs/[2](https://github.com/myrepo/actions/runs/10387836778/job/28762164196#step:4:2)024-08-14T12_46_50_808Z-debug-0.log
  ⚠️ Wrangler not found or version is incompatible. Installing...
πŸ“₯ Installing Wrangler
  /usr/local/bin/npm i wrangler@3.13.2
  npm warn deprecated @cloudflare/wrangler@1.21.0: This package is for Wrangler v1.x and is no longer supported. Please visit https://www.npmjs.com/package/wrangler for Wrangler v2+.
  npm warn deprecated sourcemap-codec@1.[4](https://github.com/myrepo/actions/runs/10387836778/job/28762164196#step:4:4).8: Please use @jridgewell/sourcemap-codec instead
  npm warn deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.

  added 8[6](https://github.com/myrepo/actions/runs/10387836778/job/28762164196#step:4:7) packages, and audited 87 packages in 11s

  10 packages are looking for funding
    run `npm fund` for details

  6 vulnerabilities (4 moderate, 1 high, 1 critical)

  To address issues that do not require attention, run:
    npm audit fix

  To address all issues (including breaking changes), run:
    npm audit fix --force

  Run `npm audit` for details.
  βœ… Wrangler installed
πŸš€ Running Wrangler Commands
  /usr/local/bin/npx wrangler deploy
  β›”  DEPRECATED β›” 
  The version of Wrangler you are using is now deprecated.
  Please update to the latest version of wrangler to prevent critical errors.
  If originally installed via npm, run `npm uninstall -g @cloudflare/wrangler && npm install -g wrangler` to update to the latest version.
  If originally installed via cargo, run `cargo uninstall wrangler && npm install -g wrangler`
  Docs migration guide: https://developers.cloudflare.com/workers/wrangler/migration/migrating-from-wrangler-1/#update-wrangler-version
  error: Found argument 'deploy' which wasn't expected, or isn't valid in this context

  USAGE:
      wrangler [FLAGS] [OPTIONS] <SUBCOMMAND>

  For more information try --help
Error: The process '/usr/local/bin/npx' failed with exit code 1
Error: 🚨 Action failed
shahsimpson commented 1 week ago

The wrangler version you are using doesn't support deploy - you'll need to update your version