GitHub Actions troubleshooting

Fix GitHub Actions Deploy Permission Denied

Permission denied usually means the workflow token, deploy key, or environment permission is too limited. Check workflow permissions before rewriting your deployment script.

Common symptoms

  • The workflow can build but cannot push or deploy.
  • Logs show permission denied, 403, or publickey.
  • Deployment works locally but not in GitHub Actions.

What to check first

Platform: GitHub Actions
Error: Permission denied during deploy

Permission denied usually means the workflow token, deploy key, or environment permission is too limited. Check workflow permissions before rewriting your deployment script.

Step-by-step fix

  1. Open repository Settings ? Actions ? General and confirm workflow permissions allow the needed write access.
  2. Add explicit permissions in the workflow, such as contents: write or pages: write, only for jobs that need them.
  3. If using SSH, store the private key in GitHub Secrets and verify the public key is installed on the target platform.
  4. Check protected environments and required reviewers if the job waits or fails at deploy.
permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  deploy:
    runs-on: ubuntu-latest

Common mistake to avoid

Do not give broad write permissions to every workflow by default. Grant the narrow permission required for the deploy job.

Still stuck?

Send the deploy log, repository link, target platform, and expected URL. ShipFast Deploy Rescue is a fixed-price debugging service for indie projects and MVPs.