Config Files
Config files in DeployHQ are files that you want to upload during a deployment, but not keep in your repository. This is particularly useful for configuration files that might contain sensitive data such as a database config file.
To add a config file, head to your project's Settings dropdown, then the Config Files option. Click to add a new config file, entering the full path to it as the name, then any data you need it to contain.
Then, you can choose where the config file will be used. Optionally, the config file can be used in the build pipeline, and also uploaded to one of more servers. These options can be individually enabled or disabled as required.
If you wish to deploy the file to certain servers, uncheck the Upload this file to all current and future servers? option and you'll be able to choose specific servers that have been configured in your project. As a result, you can set up multiple configuration files for each environment type (development, staging, production etc) and only deploy them where you need to.
Environment Variables
If you find you need to set project wide environment variables to be used with SSH commands before a deployment, therefore before the config file would've been uploaded, another option would be to add the variables to the deployment user’s .bashrc, file directly on your server.
It's worth noting, environment variables are server specific, and cannot be used with server groups.
Config files deployments
If you wish to deploy your config files but do not need to perform any other changes on your server, DeployHQ also offers the Config file deployments option for these cases.
You just need to set up your config files beforehand, and perform a config file deployment to the servers of your choice. More details on this process can be found here.