novu
novu copied to clipboard
feat(ci): build api and web Docker images with Depot
What change does this PR introduce?
This PR switches CI to use Depot for The api
and web
Docker image builds. Depot provides hosted BuildKit build servers, with managed persistent cache, for a 2-3x build speedup. Sending this PR as requested by @scopsy 🙂
There are a few remaining tasks needed before merge:
- [ ] Create the projects in your Depot organization (feel free to reply here with their IDs and I'll update the PR).
- [ ] Authorize those projects to trust GitHub Actions workflows from this repo.
For the second step, you can add a OIDC trust relationship in your Depot project settings allowing builds from this repo to use your Depot builders. That will look something like this in the project settings page:

If you plan to use Depot for PR builds, you will want to change the Workflows dropdown to All workflows
.
Feel free to ping if you have any questions or run into any issues!
Followup work
After this PR merges, there's a few followup things I can submit PRs for:
- Adding Arm builds - this is mostly a matter of adding
--platform linux/amd64,linux/arm64
to the build commands, but the Dockerfiles need some small modifications to support Arm. - Enabling the same changes for the other projects (
embed
,widget
, andws
). I think those could share the same Depot project if you'd like. - If you'd like to set up Docker builds for PRs, I can add the code that supports falling back to local
docker build
if a Depot builder isn't available (this happens for PRs from repo forks, since GitHub's security policies block access to OIDC tokens and Actions secrets for those workflows). We have a GitHub Action that makes the fallback easy.