infinitaslearning / action-publish-cloudflare-worker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

action-publish-cloudflare-worker

Reasoning

Currently, wrangler does not allow to publish a bundle without also building it first. This behaviour might be undesirable on a GitHub workflow when, for example, you want to roll back a previous version of the worker.

This GitHub actions uses cloudflare api instead of wrangler, so you can split up the building and the publishing.

πŸ“₯ Inputs

name required description
apiToken βœ… Cloudflare api token with workers privileges
scriptPath βœ… Path of the bundle script for the worker
wranglerTomlPath βœ… Path of the wrangler.toml config
tomlEnvironment βœ… Environment name as defined on wrangler.toml
cloudflareEnvironment βœ… Environment name as defined on cloudflare worker

πŸ’‘ Usage examples

Full usage example

      - uses: actions/checkout@v2
      - name: Publish Cloudflare worker
        uses: infinitaslearning/publish-cloudflare-worker@v1.0.0
        with:
          apiToken: {{ secrets.CLOUDFLARE_API_TOKEN }}
          scriptPath: 'path/to/the/bundle.js'
          wranglerTomlPath: 'path/to/wrangler.toml'
          environment: 'cf-environment-name
        env:
          CF_ACCOUNT_ID: 'CLOUDFLARE_ACCOUNT_ID'

About

License:MIT License


Languages

Language:JavaScript 100.0%