#How to deploy workers in a monorepo using github actions?

2 messages · Page 1 of 1 (latest)

pallid granite
#

I'm building a monorepo with one frontend and two workers. Using a yaml file, suggested in the cloudflare documentation to run github actions, what should I adjust for the deployment to be successful?

My current structure:
/packages
/frontend
/worker1
/worker2
/shared

Both worker1 and worker2 have imports from shared folder (import from @project/shared)

daring marten
#

I would create separate steps in your deploy action yaml for each worker, and pass the corresponding "workingDirectory" to the cloudflare wrangler-action.

The different worker directories should each have their own wrangler.toml

https://developers.cloudflare.com/workers/wrangler/ci-cd/

Cloudflare Docs

Deploy your Workers within a CI/CD environment.

GitHub

🧙‍♀️ easily deploy cloudflare workers applications using wrangler and github actions - cloudflare/wrangler-action