I used to store a cloud key in GitHub so the pipeline could deploy. It always felt wrong: a long-lived key sitting in one more place.
Now my pipelines use OIDC instead. GitHub gives each run a short-lived signed token that says "I am this repo, running this job". The cloud has a trust rule that accepts that token, and only for that repo. Nothing secret is stored in GitHub at all.
What the pipeline does on every push:
- Runs 180+ tests and a lint.
- Scans for secrets accidentally committed.
- Builds the Docker image and smoke-tests it.
- Logs in to the cloud with OIDC and pushes the image.
The IDs the pipeline needs (which identity, which project) are stored as plain variables. They're not secrets: without the trust rule on the cloud side, they're useless.
If a key can't be stolen because it doesn't exist, that's the best kind of security.