By ilonews
I have a Next.js app deployed as a web service on App Platform, because I want to take advantage of both its SSR and SSG capabilities. I’ve connected it to my CMS, which sends a webhook to Digital Ocean to trigger a redeploy when changes require a rebuild of the app.
However, DO will skip the build for any deploy in which the code doesn’t change. My question is, how can I force DO to rebuild on every deploy?
Thanks!
Justin
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!
Accepted Answer
👋🏼 @ilonews
It’s possible to force build the app from source even if a previous build can be reused, however right now it is only available via doctl and the API. The web control panel should support it soon.
With doctl, as of the v1.52.0 release, you can pass the --force-rebuild option to the doctl apps create-deployment command.
If you are using the API, the POST /v2/apps/<app_id>/deployments route accepts a JSON document for the body. You can set the force_build option in it like so:
curl \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
"https://api.digitalocean.com/v2/apps/<app_id>/deployments" \
-XPOST \
-d '{"force_build": true}'
With the new DO serverless functions you could receive the Strapi webhook request and then trigger the deployment.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.