Hi everyone!

I have a website that I built in Next JS and I’m hosting it on the App Platform with Strapi for the CMS.

When I make updates to the content in Strapi, I can see the changes take affect on my local instance of the website, but the live version won’t take the changes unless I redeploy the project by pushing code to my github repo.

Here are other deploy / build methods available that don’t seem to work:

  • The deploy button in the app platform dashboard.
  • Running ‘npm run build’ in the app platform console.
  • Manually triggering a deploy by submitting a POST request to the deployments API.

The client I built the website for is getting pretty annoyed about having to ask me to deploy content for them so any help or ideas would be greatly appreciated!

1 comment
  • More information!

    I’m using incremental static generation from Next.js, which could be important. Also to clarify, by local instance, I mean a local production build, not a dev build.

    I’ve noticed that the first step shown in the app platform dashboard is different when I build through pushing an HTML change to github versus the other deploy methods I listed.

    Steps through github push:

    1. Building Service: piezo-fed
    2. Deploying
    3. Waiting for service: piezo-fed

    Steps through other methods:

    1. Build Pending
    2. Deploying
    3. Waiting for service: piezo-fed

    Not sure if that helps, but I figure it can’t hurt!

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.

Submit an Answer
1 answer

👋🏼 @jongauthier

Thanks for the details - the steps are helpful too! What’s happening is that when you make changes in Strapi and redeploy your app, App Platform does not know about those changes and sees that your source code and other app config is the same, so it skips the build to save time.

In this case you’ll want to force a rebuild so that the new content is retrieved from Strapi. This is something that we are working on adding to the control panel soon, but for now you can do it using doctl or the API directly.

  1. Install doctl
  2. List your apps and find your app’s UUID: doctl apps list. You can also find your app’s UUID in the control panel URL.
  3. Kick off a new deployment: doctl apps create-deployment --force-rebuild <app uuid>

Let me know if you run into any issues!

  • Thank you for the reply! That totally makes sense.

    I’ve found another workaround for now in case other come across this and can’t got he doctl route.

    Next.js has a featured I hadn’t known about before called revalidate, which will rebuild cached pages if someone visits them after a certain period of time. Great video about it here

    • Nice, thanks for the update. I actually missed the part about incremental static regeneration and thought that you were deploying a static export of your site. With incremental static regeneration, revalidation is a better solution :)

  • Hello @kamaln7 i had an error of forbidden even after running the command from doctl CLI doctl apps create-deployment --force-rebuild <app uuid>
    and in the UI of apps config I’m having forbidden error when I update Spec file or updating the build command or even force rebuild and clear cache build it’s always return forbidden