luke5mo ago

Subhosting Deployments

I've been playing around with deno subhosting. I get the concept of a project and deployments in a project. I saw there is a redeploy api endpoint but it doesn't seem that you can change the code of a deployment. Is there a way to do this or is the best way to delete the previous deployment after a new deployment is successful? In this case I'm thinking of each change to a repo being a new deployment so you wouldn't want to keep the old version. Let me know if there is a better way to do this.
2 Replies
Deno AI Helper
Deno AI Helper5mo ago
In Deno Deploy, once a deployment is created, it is immutable, meaning that the code and environment variables for that deployment cannot be changed. This is by design to ensure that each deployment is a stable and consistent snapshot of your application at a specific point in time. When you have changes to your code and you want to update your deployment, you should create a new deployment. This new deployment will have its own unique URL and can be tested independently of your production environment. Regarding the old deployments, you have a couple of options: 1. Keep the old deployments: This can be useful for rollback purposes. If something goes wrong with the new deployment, you can quickly switch back to the old one. Each deployment has its own preview URL, which allows you to test it before promoting it to production. 2. Delete the old deployments: If you are certain that you no longer need the old deployments, you can delete them using the REST API. The documentation provides an endpoint for deleting deployments: DELETE /deployments/:deploymentId. This can help you manage resources and keep your project organized. In summary, the best practice for updating code in Deno Deploy is to create a new deployment for each change and then decide whether to keep or delete the old deployments based on your rollback and resource management needs. 🦕
Ezz Abuzaid
Ezz Abuzaid5mo ago
came here for the same question, the free tier is not really usable with this limit. in the same time we cannot pay $200 monthly whilst pre-revenue