Hi!
I have specified the following in a digitalocean_app block within my terraform config:
static_site {
name = "web"
build_command = "npm run build"
source_dir = "web/"
github {
branch = "main"
deploy_on_push = var.environments[each.key].web.deploy_on_push
repo = "username/repo"
}
}
Is there any configuration I can do in order for my app to not build if changes have not been made to my source_dir
? I have a monorepo setup and see no point in my static site rebuilding a new version and deploying that if I am making changes to my backend.
Also, if I have deploy_on_push set to false, how do I manually deploy my new version if I push something? I want to autodeploy in dev but control deployments in prod.
BR, Rasmus
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
For the DigitalOcean App Platform with a mono repo setup, there is currently no built-in functionality within the platform that allows you to build selectively based on changes in a specific directory.
However, you can implement a workaround using scripts in your build command that check if there are changes in your
source_dir
and skip the build if there aren’t any.Regarding manual deployment when
deploy_on_push
is set tofalse
, you can trigger deployments manually through the DigitalOcean control panel or by using the DigitalOcean API to create a deployment after pushing changes to your repository. This gives you control over when deployments occur in your production environment.The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.
Hope that helps!
- Bobby.