What Happens After You Click the Deploy Button?

What Happens After You Click the Deploy Button?

●6 ●40 ●123
calendar_today • schedule5 min read

You've finished writing the code. Everything works on your local machine. You've tested the main features, fixed the bugs, and finally pushed your changes.

Now it's time to deploy.

You click the Deploy button and wait for the application to go live.

A few moments later, you see a message saying:

Deployment Successful!

But have you ever wondered what actually happens behind that button?

Your code doesn't magically appear on a production server. There are several steps happening behind the scenes before users can access your application.

Let's understand what happens.

1. Your Code Is Sent to the Repository

In most development workflows, deployment starts with Git.

You write your code locally, commit your changes, and push them to a remote repository such as GitHub or GitLab.

For example:

git add .
git commit -m "Add candidate dashboard"
git push origin main

This sends your latest changes to the remote repository.

Depending on your project setup, pushing code to a particular branch can automatically trigger the deployment process.

2. CI/CD Pipeline Starts Running

Once your code reaches the repository, a CI/CD pipeline may start automatically.

CI means Continuous Integration.

CD means Continuous Delivery or Continuous Deployment.

The pipeline handles different steps required to prepare your application for release.

A typical pipeline might look like this:

  • Install dependencies
  • Run linting checks
  • Run automated tests
  • Build the application
  • Prepare deployment files
  • Deploy to the target environment

If an important step fails, the pipeline can stop the deployment.

This is useful because you don't want broken code reaching production without being detected.

3. Dependencies Are Installed

Your application depends on different packages and libraries.

For example, a Node.js application might use Express, Prisma, React, or other packages.

The deployment environment needs those dependencies before it can build or run your application.

For a Node.js project, this might involve:

pnpm install --frozen-lockfile

The package manager installs the required dependencies based on your lockfile.

This helps maintain consistency between development and production environments.

4. Your Application Gets Built

Now comes the build process.

For frameworks like Next.js, the application needs to be compiled and prepared for production.

For example:

pnpm build

During this process, the framework prepares the application for production use.

Depending on the framework, this may include:

  • Compiling source code
  • Optimizing JavaScript and CSS
  • Preparing server-side rendering
  • Generating static pages
  • Creating production assets

If the build fails, the deployment usually stops here.

And sometimes, code that works perfectly in development fails during the production build because of missing environment variables, incorrect imports, or configuration issues.

5. Environment Variables Are Loaded

Your application needs configuration to connect with external services.

For example:

DATABASE_URL=your_database_url
JWT_SECRET=your_secret
REDIS_URL=your_redis_url

These values are usually configured in the hosting platform or deployment environment.

They should not be hardcoded into your source code or exposed publicly.

One common deployment issue is forgetting to configure an environment variable.

Everything works locally because your local .env file contains the required values.

But production doesn't automatically have access to that file.

The application starts, tries to connect to the database, and fails.

That's why environment configuration is an important part of deployment.

6. Database Migrations May Run

This is one of the most important steps when deploying applications that use a database.

Imagine you've added a new field to your Prisma schema.

Your application code expects that field, but the production database doesn't have it yet.

The application may fail when it tries to access that data.

Database migrations help keep the database structure in sync with your application changes.

For example, with Prisma:

pnpm prisma migrate deploy

This applies pending migrations to the target database.

However, migrations need proper planning.

A careless database change can affect existing data or break older versions of the application.

Always understand what a migration changes before running it in production.

7. Your Application Is Deployed to the Server

After the required checks and build steps succeed, the deployment platform prepares your application to run.

Depending on your infrastructure, this can happen in different ways.

For example:

Traditional server deployment:

  • Application files are transferred to the server.
  • Dependencies and runtime configuration are prepared.
  • The application process is started or restarted.

Docker-based deployment:

  • A Docker image is built.
  • The image is tagged.
  • It is pushed to a container registry such as Amazon ECR.
  • The production environment pulls the image and starts containers.

A simplified Docker workflow might look like this:

docker build -t my-app .
docker push my-registry/my-app:latest

In an AWS ECS setup, ECS can then use the new image to run updated tasks.

This is how your new application version reaches the production environment.

8. The Application Starts Running

Deployment doesn't end when the files reach the server.

The application needs to start successfully.

The server must be able to:

  • Load the required configuration
  • Connect to the database
  • Connect to Redis or other services if needed
  • Start background workers
  • Open the required network ports
  • Handle incoming requests

If something fails during startup, the application may crash or repeatedly restart.

That's why checking application logs after deployment is important.

A successful build doesn't always mean a successfully running application.

9. Health Checks and Load Balancing

In production environments, especially when using multiple application instances, health checks help determine whether an instance is ready to receive traffic.

For example, a health endpoint might return:

{
  "status": "healthy"
}

A load balancer can use health checks to identify healthy instances and route requests accordingly.

If a new instance isn't ready, the load balancer can avoid sending traffic to it.

This helps reduce downtime during deployments.

10. Users Finally Access the Updated Application

Once the new version is running and ready, users can start accessing it.

They might visit your website, log in, submit forms, upload files, or use the new features.

But here's something important:

Deployment successful doesn't automatically mean production is working perfectly.

You still need to verify the actual application.

Check important pages, APIs, authentication, database operations, and any critical business workflows.

Sometimes, an issue only appears when real users start interacting with the application.

11. Monitoring Starts After Deployment

A good deployment process doesn't stop after the application goes live.

You need to monitor what happens next.

Look for:

  • Application errors
  • Failed API requests
  • Slow database queries
  • High CPU or memory usage
  • Failed background jobs
  • Unusual traffic patterns

Tools like CloudWatch, Grafana, and application logging systems can help identify problems.

If something goes wrong, you need enough information to investigate it quickly.

And if the new release causes a serious issue, you may need to roll back to a previous working version.

That's why having a rollback plan matters.

Why Deployment Is More Than Clicking a Button

When you're learning development, deployment can look like a simple final step.

Build the application, upload the files, and share the link.

But real production deployments involve much more.

Code quality, automated testing, environment configuration, database migrations, containers, server availability, monitoring, and rollback strategies all play an important role.

A small mistake in any of these steps can affect the entire application.

And that's why deployment deserves the same attention as development.

Final Thoughts

The next time you click the Deploy button, remember that several processes may be running behind it.

Your code is being checked, dependencies are being installed, the application is being built, configuration is being loaded, and production infrastructure is preparing to run the new version.

And even after the deployment succeeds, the real test begins when users start using your application.

Writing code builds the application. Deploying it makes it available. Maintaining it keeps it reliable.

That's the part of software engineering that happens after you click the button.

Want more #development & #development deep dives?

Join 6,168+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

AAIF Hits 10 Projects. Its CTO on What to Adopt Now and the Security Gaps Left Open

Tom Smithverified - Oct 23

Cisco's Amy Chang: A Model's "Passport" Doesn't Tell You Where It Actually Came From

Tom Smithverified - Aug 27

GST and Job Work Management in India: What Manufacturers Should Know About ERP Software

Nusrat Fatema - Nov 16

Reverse Engineering Netflix: What Actually Happens When We Click Play?

sravanya-2006 - Jul 4

What Security Teams Want From AI Agents Before They Let Them Act Alone

Tom Smithverified - Nov 18
chevron_left
7.1k Points • 169 Badges
Kolkata,WB,IND • edulumix.in
64Posts
34Comments
27Connections
Software Engineer @2Coms Group

Related Jobs

Commenters (This Week)

13 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!