App Platform - How to use different spec files with secrets for different environments (e.g. testing, staging and production) ?

I notice it is possible to associate a particular repo and branch to a DO app, but we cannot configure where to look for a specific spec file.

Furthermore, there is the question on how to handle different secret variables according to the environment.

Submit an answer

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!

Sign In or Sign Up to Answer

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.


I believe that spec files are mainly useful when you are using the DigitalOcean API or the doctl command-line tool.

In this case you could have different spec files for each environment with a prefix of the specific environment, and use that file for your deployment.

Then you could use the doctl apps create --spec <path-to-spec> command to create your App.

For more information on app specifications I could suggest the documentation here:

Hope that this helps. Best, Bobby