I’m trying to deploy a theme from the terminal and am pretty sure that I have followed the instructions correctly https://github.com/TryGhost/action-deploy-theme?ref=ghost.org
And have tried using both the content key and the admin API key.
But I keep getting this error from Github Actions when I try to deploy
Run TryGhost/action-deploy-theme@v1
Error: @tryghost/admin-api Config Invalid: 'key' must have 26 hex characters
at GhostAdminAPI (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:3214:15)
at new GhostAdminAPI (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:3129:16)
at main (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:43115:21)
at /home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:43146:2
at /home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:43148:3
at Object.<anonymous> (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:43151:12)
at Module._compile (node:internal/modules/cjs/loader:1521:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1623:10)
at Module.load (node:internal/modules/cjs/loader:1266:32)
at Module._load (node:internal/modules/cjs/loader:1091:12)
Any ideas for how to debug? Thanks!
If that’s the action I think it is, it deploys when you push to GitHub, and you need secrets set in GitHub to make that work. It takes the admin api key, not content. (Content is read-only.)
Settings needed are shown here: Official Ghost + GitHub Integration
It isn’t really a command line deploy, unless you’re pushing to GitHub as the command 
1 Like
Hi yes, I set this up in order to push the changes to get hob that would then make it through to our live site.
I only tried the content key because I had tried the admin key and it wasn’t working.
The error I get above is what happens after I follow the instructions in the link that you sent.
Any clues? Thanks
The error you posted suggests you don’t have a valid admin API key available to the function. Perhaps you made a copy paste error? I’d try restoring the admin api key and url (carefully checking that the variable names are exactly matching what’s in the action .yml file) and try running it again. That error suggests that the API key isn’t there (or is there with the wrong name) or isn’t the right length.
Hi and thanks again for your advice. I have just tried this all again, issuing a whole new API integration to go through the steps, using the copy function and checking the key is correct, and I am still getting an invalid key error. I have done this numerous times now, methodically attempting to avoid any possible basic mistakes. I’m already not sure why this isn’t working for me.
Is there any other advice you can offer?
relevant screengrabs (I was going to put four but I’m only allowed to put one as a new user)
the .yml
integration secrets page on ghost
github secrets definitions
error log
Hmm. I’ve got my secrets in repository secrets, not environment secrets. Here’s a working example:
Try that?
Should’ve tried that before. That works! Thanks so much for your patience!!
1 Like