Deploying a Website to Cloud Hosting: From Git Repository to Production
developer hostingGit deploymentCI/CDcloud deploymentrelease management

Deploying a Website to Cloud Hosting: From Git Repository to Production

wwhites.cloud Editorial Team
2026-11-15
7 min read

A practical Git-to-cloud deployment checklist covering staging, secrets, migrations, DNS, SSL, rollback, and post-launch checks.

Deploying from a Git repository to cloud hosting is safer when it is treated as a controlled release rather than a button click. This guide provides a reusable workflow for preparing environments, testing a build, migrating data, switching DNS, validating SSL, and rolling back if production does not behave as expected.

Overview

A reliable Git deployment workflow separates code changes from production changes. The repository should contain the application source and deployment configuration, while secrets, production data, and infrastructure credentials remain outside version control. A typical release moves through four stages:

  1. Prepare: confirm the branch, dependencies, runtime, environment variables, and rollback point.
  2. Build and test: create the same type of artifact that cloud hosting will run, then test it in an environment that resembles production.
  3. Release: deploy to staging or production, apply database changes carefully, and verify the application before changing traffic.
  4. Observe: monitor availability, errors, performance, logs, and user-facing flows after launch.

The exact controls vary between platforms and frameworks, but the underlying principle is stable: make every production change identifiable, reversible, and observable. Managed cloud hosting can simplify runtime provisioning and SSL administration, but it does not remove the need for release planning.

Checklist by scenario

1. First deployment of a new site

  • Confirm the production domain, preferred canonical hostname, and whether both the root domain and www hostname are needed.
  • Connect the cloud hosting project to the correct Git repository and deployment branch. Avoid using a personal development branch as the long-term production source.
  • Record the required runtime version, package manager, build command, start command, and output directory. For a static site, the output directory may be the only runtime setting required.
  • Create production environment variables in the hosting control panel or secret manager. Include database URLs, API credentials, session secrets, and service endpoints without committing their values to Git.
  • Deploy a temporary staging hostname first. Check navigation, forms, authentication, image delivery, redirects, and any server-side functionality.
  • Set up the required DNS records and verify them with a DNS propagation checker before making the domain live. For background on record types, see this practical DNS records guide.
  • Confirm that the hosting platform has issued and attached an SSL certificate for every required hostname. Test HTTP-to-HTTPS redirects and check for mixed-content warnings.

2. Routine release from Git

  • Start with a clean working tree and a reviewed pull request or equivalent change record.
  • Run unit tests, linting, type checks, and a production build locally or in CI. A successful local development server is not proof that the production build will succeed.
  • Check dependency changes for lockfile updates, native packages, migrations, and changes to required environment variables.
  • Deploy the same commit to staging, then test the highest-value user journeys rather than only the homepage.
  • Write down the commit identifier and confirm that the hosting dashboard reports the same version.
  • Deploy during a period when someone can inspect logs and respond. Do not assume that an automated deployment is self-verifying.
  • After release, test the public site from an independent network and review application, access, and platform logs.

3. Release involving a database migration

  • Take a verified backup before changing production data. A backup is useful only if the team knows where it is stored and how restoration works; use this cloud recovery checklist to review the process.
  • Determine whether the migration is backward compatible with the currently running application.
  • Prefer an expand-and-contract sequence for important systems: add compatible fields or tables, deploy code that can use both versions, migrate data, and remove obsolete structures only after validation.
  • Estimate migration duration and confirm whether it locks tables, consumes substantial resources, or requires a maintenance window.
  • Keep application deployment and schema migration steps separately identifiable so a failed migration is easier to diagnose.
  • Verify record counts, critical queries, background jobs, and write operations after the migration.

4. Moving an existing website to new cloud hosting

  • Lower DNS TTL ahead of the planned cutover where appropriate, while remembering that cached records may still persist beyond the stated TTL.
  • Copy files, databases, scheduled jobs, storage objects, and configuration—not just the Git repository.
  • Test the new environment using a temporary hostname, hosts-file override, preview URL, or equivalent private route.
  • Compare redirects, URL handling, email forms, cron tasks, webhook endpoints, and third-party integrations.
  • Keep the old host available until the new site has passed post-cutover checks and the rollback decision window has closed.
  • Switch DNS only after SSL, health checks, backups, and monitoring are ready. DNS and managed DNS planning are covered in this migration and failover checklist.

What to double-check before production

Environment separation: Confirm that staging cannot send real customer emails, charge a payment method, overwrite production data, or use production credentials unintentionally. Use distinct databases and credentials whenever possible.

Build reproducibility: Pin the runtime and dependency versions where the platform permits it, commit the lockfile, and make the build command explicit. Record required system packages and build-time variables so another operator can reproduce the release.

Secrets: Search the repository and build logs for accidentally exposed tokens. Rotate any credential that has been committed or printed. Do not place secrets in client-side variables; values shipped to browser code should be treated as public.

DNS and email: A website cutover should not accidentally interrupt mail. Review MX, SPF, DKIM, DMARC, verification, and CAA records before editing nameservers or replacing a DNS zone. The email authentication checklist can help separate website changes from mail requirements.

SSL: Test the final hostname, certificate chain, redirect behavior, and asset URLs. If browsers report warnings, use the SSL troubleshooting guide rather than treating the warning as a cosmetic issue.

Rollback: Define what triggers a rollback, who can authorize it, and how it will be performed. Keep the previous application version available, but remember that rolling back code may not reverse a destructive database migration. A rollback plan should include communication, data handling, and a follow-up fix.

Monitoring: Establish an external uptime check, error alerting, and log access before launch. Review response codes, latency, resource use, and important transactions—not just whether the homepage returns a 200 response. See what to measure during uptime monitoring for a broader operational checklist.

Common mistakes

  • Deploying directly from an unreviewed branch: This makes the release difficult to audit and can include unfinished work.
  • Testing only on localhost: Production often differs in environment variables, file permissions, caching, domains, and database behavior.
  • Changing DNS before preparing SSL: Visitors may encounter certificate errors even when the application itself is healthy.
  • Committing secrets to Git: Deleting a secret from the latest commit does not guarantee that it has disappeared from history or build artifacts. Rotate it.
  • Running an irreversible migration without a restore test: A backup that has never been restored is an assumption, not a complete recovery plan.
  • Ignoring non-web processes: Queue workers, scheduled tasks, webhooks, object storage, and transactional email can fail while the main page appears normal.
  • Keeping no release record: Record the deployed commit, migration status, operator, time, and notable configuration changes. This shortens incident investigation.

When to revisit

Use this workflow before every first production launch, major framework or runtime upgrade, hosting migration, domain change, database migration, and significant CI/CD change. Revisit it before seasonal planning cycles as well, especially when expected traffic, campaign activity, staffing, or support coverage will change.

Update the checklist when the hosting platform changes its deployment interface, supported runtimes, build behavior, secret management, SSL process, database tooling, or Git integration. Framework upgrades may also change build commands, output directories, environment-variable conventions, or server requirements.

For the next release, copy this short production-readiness list into the change record:

  1. Correct commit reviewed and tests passing.
  2. Build, runtime, environment variables, and secrets verified.
  3. Staging user journeys tested.
  4. Database backup and migration plan confirmed.
  5. DNS, email records, SSL, redirects, and canonical hostname checked.
  6. Monitoring, logs, support ownership, and rollback steps ready.
  7. Post-deployment checks completed and the release recorded.

A Git-to-cloud deployment is complete only when the public application, its supporting services, and its recovery path have all been checked. Treat the checklist as a living release tool, and revise it whenever the application or hosting workflow changes.

Related Topics

#developer hosting#Git deployment#CI/CD#cloud deployment#release management
w

whites.cloud Editorial Team

Technical Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.