Skip to content

This GitHub Action takes 30s to run, it should be 10x faster #443

Description

@fulldecent

Using this wrangler-action is unnecessarily slow and therefore consumes significant resources across the universe of people using it.

Evidence

Here is my deploy script in GitHub Actions using this wrangler-action:

  # Deploy acls.net to Cloudflare Pages
  deploy-acls-net:
    name: Deploy acls.net
    runs-on: ubuntu-latest
    needs: [filter, build]
    if: needs.filter.outputs.acls_net_changed == 'true' || needs.filter.outputs.shared_changed == 'true'
    concurrency:
      group: deploy-acls-net-${{ github.ref }}
      cancel-in-progress: false
    environment:
      name: acls.net
      url: ${{ steps.deploy.outputs.deployment-url }}
    outputs:
      preview-url: ${{ steps.deploy.outputs.deployment-url }}
    steps:
      - name: Download artifact
        uses: actions/download-artifact@v8
        with:
          name: acls-net-build
          path: build/

      # NOTE: Cloudflare Pages deployments are atomic. The live production URL is only updated
      # once the entire build is verified on their network. Interrupted builds do not affect the live site.
      - name: Deploy to Cloudflare Pages
        id: deploy
        uses: cloudflare/wrangler-action@v4
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          command: pages deploy build/ --project-name=acls-net --branch=${{ github.head_ref || github.ref_name }}

Here is how much CI time this consumes just installing Wrangler before it actually uses it (pasted from a GitHub Action run receipt).

Run cloudflare/wrangler-action@v4
🔍 Checking for existing Wrangler installation
📥 Installing Wrangler
  /usr/local/bin/npm i wrangler@4
  
  added 38 packages in 29s
... [ CLIPPED HERE ]

Expectation

If you replace usage of this wrangler-action GitHub Action and instead use the GitHub's first-party supported setup node action, you can achieve 10x speed-up today.

Recommendation

I recommend that Cloudflare study this technique and implement it themselves to achieve this 10x speed-up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions