Use GitHub Actions to test and deploy a site or app with secrets, permissions and release steps that your business can see and control.
The short answer
What should a GitHub Actions deployment setup include?
Automated tests, a deploy step that needs approval for production, secrets stored as secrets, and read-only default token permissions. Your business should own the repository and be able to see every release.
A concept of repository permissions and environment deployment.
From
Repository change
Reads
To
Hosting environment
Writes
Commit or pull request
Source: Secure use reference for GitHub Actions (GitHub)Checked
Source: Secure use reference for GitHub Actions (GitHub)Checked
Source: Secure use reference for GitHub Actions (GitHub)Checked
name: Release
on:
push:
branches: [main]
permissions:
contents: read
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@<full-commit-sha>
- run: npm ci && npm test
deploy-prod:
needs: verify
environment: production
runs-on: ubuntu-latest
steps:
- run: echo "Deploy after reviewer approval"Checks, pinned action SHAs and explicit read-only token permissions.
Which keys live in GitHub Environments and who can rotate them.
Steps to redeploy the previous release commit if verification fails.
Facts reviewed as of
Tell us how you deploy today and who needs to approve a release.