GitHub Actions for EngineersDeployment Workflows

Deployment Workflows

Deploy to Vercel, AWS, and Docker registries.

~25 min read

Deployment Workflows

Deploy to Vercel

- name: Deploy to Vercel
  uses: amondnet/vercel-action@v25
  with:
    vercel-token: ${{ secrets.VERCEL_TOKEN }}
    vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
    vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
    vercel-args: '--prod'

Docker build and push

- name: Build and push Docker image
  uses: docker/build-push-action@v5
  with:
    context: .
    push: true
    tags: |
      ghcr.io/${{ github.repository }}:latest
      ghcr.io/${{ github.repository }}:${{ github.sha }}

Environment protection rules

Set up environments (Settings → Environments) to require:

  • Manual approval before production deploys
  • Branch restrictions (only main can deploy to prod)
  • Required reviewers
jobs:
  deploy:
    environment: production  # Uses environment rules
    steps:
      - run: ./deploy-prod.sh