renlabs-dev / commune-ts

This is a monorepo for the AGIc typescript ecosystem. It uses Turborepo and contains the code for our web apps.
https://www.communeai.org/
5 stars 1 forks source link

Switch from Cloudflare Pages to DigitalOcean on monorepo / next.js apps #56

Open DaviPtrs opened 4 months ago

DaviPtrs commented 4 months ago

2 scenarios:

  1. Use the digital ocean build environment like shown below (only if it's not fucked up like on Cloudflare Pages) https://docs.digitalocean.com/products/app-platform/how-to/deploy-from-monorepo/ https://github.com/digitalocean/sample-monorepo https://docs.digitalocean.com/products/app-platform/reference/buildpacks/nodejs/ https://www.youtube.com/watch?v=PmFtK01G_A8

  2. Use our own build environment (with cicd pipelining) For that option I'm considering Drone CI, because it's open source and it has support for adding features as a extension. Github Actions is absolutely awful for conditional path pipelines and Circle CI is better but far beyond being good. https://www.drone.io/ https://www.youtube.com/watch?v=-VfJq2UKYCE https://github.com/meltwater/drone-convert-pathschanged


TODO list from the old task:

DaviPtrs commented 3 months ago

For now we're using the built in build environment but already found a bug

Image

The build environment often "loses" the next binary

Image

The current workaround is to force rebuild while clearing the build cache

Image

Image

DaviPtrs commented 3 months ago

Summary

We are using Drone CI for most deployments, while others are still being built in the Digital Ocean build environment. All deployments handled by Drone CI are being built as Docker images and then the Digital Ocean app is pointing to the branch Docker tag (main for production and dev for development).

communex-page (Static SPA site built by Digital Ocean)

PROD: https://communex.ai/ , https://communex-page-xw7rh.ondigitalocean.app/ DEV: https://dev.communex.ai/ , https://dev-communex-page-8aoym.ondigitalocean.app/

commune-governance (Drone CI for docker image) (not gone live yet)

PROD: https://commune-governance-q32fh.ondigitalocean.app/ DEV: https://dev-commune-governance-4goke.ondigitalocean.app/

community validator (Drone CI for docker image)

PROD: https://validator.communeai.net/ , https://community-validator-engn6.ondigitalocean.app/ DEV: https://dev.validator.communeai.net/ , https://dev-community-validator-cqpy5.ondigitalocean.app/

commune page (Drone CI for docker image)

PROD: https://communeai.org/ , https://commune-page-xsrfo.ondigitalocean.app/ DEV: https://dev.communeai.org/ , https://dev-commune-page-33rl9.ondigitalocean.app/

comrads-worker (Drone CI for docker image)

It's being deployed under the same app as community-validator

Image

DaviPtrs commented 3 months ago

@EdSDR Do you think is a good idea to put the above guide on the monorepo readme?