Deploying a website from Git to cloud hosting is safer and easier to repeat when the workflow separates development, staging, and production. This checklist covers repository setup, build commands, environment variables, database changes, approval, smoke testing, and rollback so each release has a clear path forward—and a controlled way back.
Overview
A Git-based deployment workflow treats every release as a recorded change rather than an improvised file upload. Developers work in branches, changes are reviewed and merged, and the hosting platform builds a known commit before publishing it. The exact controls vary between cloud hosting providers, but the sequence is broadly consistent.
A practical deployment path looks like this:
- Develop and test changes in a local environment.
- Push the branch to a Git provider and review the change.
- Deploy the branch or pull request to a staging environment.
- Run automated checks and manual smoke tests.
- Approve a specific commit for production.
- Monitor the release and retain a rollback option.
Staging should resemble production closely enough to expose configuration, routing, asset, and database problems before visitors encounter them. It does not need to duplicate every production resource, but it should use the same runtime family, build process, environment-variable names, and deployment assumptions wherever possible.
Before choosing a workflow, confirm what your hosting plan supports: Git provider integration, automatic builds, preview deployments, protected environment variables, deployment logs, health checks, and rollback options. For broader infrastructure decisions, see this comparison of cloud, shared, VPS, and managed hosting.
Checklist by scenario
1. First-time repository deployment
- Create or confirm a repository with a clear default branch.
- Remove passwords, API keys, private certificates, and database credentials from tracked files.
- Add a documented build command, start command, required runtime version, and output directory if applicable.
- Define an ignore file for dependencies, local configuration, logs, build output, and operating-system files.
- Connect the repository to the cloud host using the narrowest practical access permission.
- Choose the branch that deploys to staging and document how production deployments are triggered.
- Run one staging deployment and inspect the complete build and runtime logs.
Do not assume that a successful build means the site is ready. A build can pass while the application cannot connect to its database, serve static assets, resolve a domain, or authenticate with an external service.
2. Deploying a normal application change
- Start from an up-to-date development branch.
- Create a focused branch for the change and keep unrelated edits separate.
- Run local tests, linting, type checks, and the production build when those commands are available.
- Open a review that explains the user impact, configuration changes, migrations, and rollback plan.
- Deploy the branch or merge candidate to staging.
- Test the affected feature and at least one critical path, such as sign-in, checkout, contact submission, or content publishing.
- Merge only after the agreed checks pass, then deploy the approved commit to production.
Record the commit identifier, deploy time, person approving the release, and any follow-up task. This small deployment record makes later troubleshooting much faster.
3. Changing environment variables or secrets
- List the variable name, purpose, environment, and whether it is public or secret.
- Set staging and production values separately; never copy production secrets into a shared test environment without a clear reason.
- Confirm whether variables are available during the build, at runtime, or both.
- Check whether a frontend framework embeds selected variables into browser-delivered files. Anything shipped to the browser should be treated as public.
- Deploy to staging and verify the integration using test credentials or a safe test endpoint.
- Change production values through the hosting platform or approved secret manager, not through Git.
- Plan a rollback for the application and the configuration change. Reverting code alone may not restore a previous secret or endpoint.
Use descriptive names and maintain a non-secret configuration example, such as .env.example, with placeholder values. This helps new developers understand requirements without exposing credentials.
4. Releasing database changes
- Back up the database according to your existing recovery process.
- Test the migration against a representative staging database.
- Determine whether the change is backward compatible with the currently running application.
- Deploy schema changes before application code when both versions must coexist briefly.
- Separate destructive cleanup from the initial release where practical.
- Verify indexes, constraints, data conversion, and application queries after deployment.
- Document how to reverse or repair the change. Some migrations cannot be safely undone automatically.
For WordPress or other content-managed sites, include files, database content, plugins, themes, and configuration in the release plan. The WordPress and site migration checklist provides a useful companion for larger moves.
5. Handling a failed production release
- Pause additional deployments and identify the exact production commit.
- Check deployment logs, application logs, recent configuration changes, and monitoring alerts.
- Decide whether a quick fix is safer than a rollback. Avoid making several unrecorded changes during an incident.
- Roll back to the last known-good build or commit if the failure is caused by application code and the data layer remains compatible.
- Run smoke tests after the rollback, then communicate the current status to affected stakeholders.
- Open a follow-up review that identifies the trigger, detection gap, and prevention task.
What to double-check
Before approving a release, inspect the areas most likely to differ between a developer machine, staging, and production:
- Runtime: Confirm the language version, package manager, system dependencies, and build flags.
- Routing: Test direct visits to nested URLs, redirects, custom error pages, and API routes.
- Assets: Check generated JavaScript, CSS, images, fonts, cache-busting, and case-sensitive file paths.
- Configuration: Verify URLs, allowed origins, callback addresses, email settings, storage buckets, and feature flags.
- Domains and SSL: Confirm that the production domain points to the intended host and that HTTPS works without mixed-content warnings. Use the SSL troubleshooting guide if browser errors appear.
- Performance: Compare response time, caching behavior, resource usage, and page loading after deployment. The hosting performance audit checklist can guide this review.
- Observability: Confirm that uptime checks, error alerts, logs, and application health endpoints are still active.
- Security: Ensure debug mode is disabled, access controls remain enforced, and secrets do not appear in logs or client-side bundles.
A useful smoke test is short and repeatable: load the homepage, sign in with a test account, submit a key form, exercise the changed feature, open a deep link, and check one important background task or integration.
Common mistakes
- Deploying directly from an unreviewed branch: Require a review or documented approval for production changes.
- Using identical staging and production secrets: Keep environments isolated and use test accounts where possible.
- Testing only the homepage: Check the paths and integrations affected by the release, not just whether the server responds.
- Ignoring build logs: Warnings about missing variables, skipped migrations, dependency conflicts, or fallback settings can become production failures.
- Assuming Git revert reverses everything: A code revert does not automatically undo database writes, uploaded files, external messages, or configuration changes.
- Allowing untracked manual edits: Changes made directly on the server can disappear during the next deployment and make rollback behavior unpredictable.
- Skipping backups before data changes: A tested backup and a known restoration process are part of the release, not an optional emergency measure.
For security and recovery practices that apply to WordPress installations, review the WordPress website security checklist and the backup and restore checklist.
When to revisit
Revisit this workflow before seasonal planning cycles, major campaigns, platform migrations, and periods when traffic or release frequency is expected to increase. Review it immediately when the hosting provider changes its Git integration, supported runtimes, build settings, environment-variable behavior, deployment permissions, or rollback controls.
Also update the checklist after an incident, a new database pattern, a change in team ownership, or the introduction of a new framework or CI/CD tool. A quarterly review can be useful even when nothing appears to have changed: verify that the documented commands still work, staging still resembles production, backups can be restored, and monitoring alerts reach the right people.
Before your next release, copy this short sequence into the deployment record:
- Commit and branch:
- Build and test results:
- Staging URL and smoke-test results:
- Environment or database changes:
- Approved production commit:
- Rollback target and owner:
- Post-release monitoring result:
Keep the record with the release or pull request. Over time, these records reveal recurring failure points and turn deployment from a fragile handoff into a measurable, repeatable part of running a website.