Question

Disable auto-deploy on Apps platform for certain commits

Posted February 8, 2021 722 views
GitDeployment

I am using the Apps platform to deploy a Statamic site, and I have trouble customizing the Github connection for my needs.

Statamic is a CMS framework built on top of Laravel, which uses a flat-file system to store its content. Statamic offers a Git integration that uses automatic commits when users make changes to the content. So my problem with the Apps platform, is that it makes an auto-deploy every time a new commit appears in the repository. So if I set up the Git integration in Statamic every time a user changes the content it would make an unnecessary deployment.

The official Statamic documentation recommends to customize the automatic commit messages and update the deploy script to ignore these type of commits. I checked the official Digital Ocean docs about the options I can use in the Apps spec file but couldn’t find anything useful.

https://www.digitalocean.com/docs/app-platform/references/app-specification-reference/

I see I can set deploy_on_push to false to have full control over the deployment, but it’s not the most ideal solution for my problem.

Is there anything I can do to make this work automatically?

1 comment
  • Hey Adam, did you manage to get Statamic working with DO App Platform? I’m trying to do the same thing but running into some issues.

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

👋 @adamtroll

Interesting use-case! Here’s a possible solution:

Create another branch (eg. production) and set that as the auto-deploy branch in App Platform. Then configure your statamic git integration to pull from your default branch (eg. main or master).

This way content changes will be push into the default and pulled by statamic automatically without triggering a rebuild on App Platform. When changes that require a rebuild a merge to the production branch will trigger that.

  • Thank you for the help. I really don’t know why I didn’t think about using branches for this 🤦‍♂️. Anyway, I think the Apps platform would benefit from such or similar functionalities. EG.: the ability to run auto-deployment on Github releases only.