Skip to content
Discussion options

You must be logged in to vote
  1. Branch Strategy
    main → production (example.com)
    staging → staging (staging.example.com)
    feature/* → no deploy

Only staging and main trigger deployments.

  1. Server Directory Layout (recommended)

On your server:

/var/www/
├── app-staging/
│ └── current/
└── app-production/
└── current/

Your web server (Nginx/Apache) points each domain to its respective current folder.

  1. GitHub Secrets (Repository → Settings → Secrets)

Add once, reused by workflows:

Secret name Description
SSH_HOST Server IP or hostname
SSH_USER SSH username
SSH_PRIVATE_KEY Private key (no passphrase)
STAGING_PATH /var/www/app-staging/current
PRODUCTION_PATH /var/www/app-production/current

🔐 Important:

Use a deploy-only SSH…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alekseisokolov562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD other General topics and discussions that don't fit into other categories, but are related to GitHub Question Ask and answer questions about GitHub features and usage Workflow Configuration Topics about workflow files, YAML setup, job dependencies, and general workflow configuration issues
2 participants