Environment secrets in GitHub Actions

Environment secrets are credentials associated with a GitHub Actions environment such as production or staging. They become available to eligible jobs using that environment, allowing teams to separate deployment credentials from ordinary CI permissions and apply protection rules such as required approvals.

Minimal example

yaml
deploy:
  environment: production
  steps:
    - name: Deploy
      run: ./deploy.sh

Learn this concept

Lesson 7.3 · Gated CI image publishing

Used in exercises

Exercise 7.4 · Backend CI workflow
Prerequisite conceptsGitHub Actions