Update .env after deploy

I modified composer so that It would include ACF Pro. Works fine in dev, but deploying to staging fails

“Could not find a key for ACF PRO. Please make it available via the environment variable ACF_PRO_KEY”

So I modified ./site/.env

ACF_PRO_KEY='xxxxmyvalidlicencekeyxxxx';

ran deploy again. Same issue.

So i edited the /config/environments/staging.php, adding

define('ACF_PRO_KEY', 'xxxxmyvalidlicencekeyxxxx');

Committed the staging branch, deployed again. Same.

So I logged via ssh to the staging machine, manually made the same modifications to the /current/config/enviornments/staging.php and /site/.env files.

Same error message.

I’m at loss here. Where should I add the constant so that composer picks it up?
Thank you,
A.

Take a look at this thread which runs through how to add the ACF key to your vault.yml files which will update .env on deploy.

2 Likes

I unlisted this thread since it’s basically a duplicate. You can use the other thread for follow-ups.