This is namely a github action which helps deploy Cloudflare workers via wrangler CLI. There is an official action from Cloudflare, however, it doesn't support Rust (via wasm-bindgen) for now as this issue describes.
name: Build on feature branch
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v2
- name: Publish
uses: alank976/wrangler-action-for-rust@1.0.0
publish: false
preCommands: wrangler build
name: Deploy
on:
push:
branches:
- master
- main
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v2
- name: Publish
uses: alank976/wrangler-action-for-rust@1.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
This action uses Rust as base image instead of node since Rust compiler is relatively larger so this way betters off the docker caching layer. This docker image basically is a Rust + Node + Wrangler after all.
As mentioned, there are several versions have to be managed. We have Rust, NVM, Node, and wrangler. Only wrangler's can be specified via Action inputs and the rest of aforementioned are locked-in versions.
This action simply uses subset of the official one, but remove the legacy ones
Please refer to the official one for details