How should I deploy secret key file like Google Cloud key file that is a .json file during deployment. Currently I am using very unsafe method that download the key file I put in some random bucket using hook in the Envoyer each time app being deployed.
Assuming you are not changing the key often and because of its sensitive nature, I usually ssh into the box and create file with vi outside the site directory so that it doesn't get overwritten or removed during a deployment. For example, placing it right next to the .env file. That is really the easiest way to do it because it usually only happens once for the box.