Skip to content

Setup using github actions

You can now setup and keep your project updated using github actions.

New project

Start by creating a new fork of the github repository here.

Fork

Create a new API Token as described in the official Cloudflare Docs.

Then, in your new repository go to Settings -> Secret and variables -> Actions -> New repository secret.

new secret

Create a new secret with the name CF_API_TOKEN and the value as the newly created token.

add cf token

Now switch to the variables tab and create the following variables:

  • R2EXPLORER_WORKER_NAME this is the worker named used to identify the worker in your Cloudflare account.
  • R2EXPLORER_CONFIG object with the R2-explorer configuration, read more here.
  • R2EXPLORER_BUCKETS buckets in the format {r2-explorer name}:{bucket name}, define one bucket per line.
  • R2EXPLORER_DOMAIN optional domain name used to serve the R2-explorer instance, when not set, you will be given a workers.dev domain.

Example variables:

  • R2EXPLORER_WORKER_NAME => my-r2-explorer
  • R2EXPLORER_CONFIG => { readonly: true }
  • R2EXPLORER_BUCKETS => example-1:r2-explorer-example-1
  • R2EXPLORER_DOMAIN => my-domain.com

add variables

Now go to the github repository and click Actions -> I understand my workflows, go ahead and enable them.

enable actions

Trigger a deploy

After enabling actions, go ahead and trigger a new deploy, you can use this flow at any time to re-deploy your application.

Click Actions -> Deploy -> Run workflow -> Run workflow.

trigger update

Updating

To update your github action project, read more in the update your project section.