Programming

Deploy

What is Deploy?

Deploy means to place. You fix the page on your own machine. The address there is localhost, and someone else does not see it. Deploy moves that file to a machine that stays on day and night, that is, to hosting. After the move a person types the domain and sees this version of yours. Git push does not do this by itself. Push puts the history on GitHub. If the site itself does not rise from that history automatically, a visitor sees the old page or nothing. Some services deploy by themselves after a push. That happens because you set it, not because of a magic in push. Deploy can be once, or on every fix. An old version should stay so you can return if the new one breaks. A secret key, a half-finished mistake, and text that was only for a test should not fall into this move.

What is Deploy used for?

Deploy opens a finished version to a visitor. The check stays on localhost before that.

  • Opening a fixed page to someone else
  • Replacing an old version with a new one
  • Moving a tested file to hosting
  • Returning from a broken version to the previous one

What can you do with Deploy?

With deploy you put the file of this hour where people see it. It can be a command, or a button on a site. The result is the same: the old address shows the new file. Git keeps history. Deploy changes the running page. If the history was sent and the page did not change, it was not deployed. If the page changed, a visitor now also sees your new mistake. So open it on localhost first, then deploy. If you wrote a secret key inside the file, do not place it. The key has to stay in the server's own place.

Is Deploy hard to learn?

Pressing a button looks easy. The difficulty is the mix of the old and the new. A cache can show the old page, and you think the change did not go. A half-finished deploy can make the page white. If the old version was not kept, there is no way back. Another mistake is to push to GitHub and think the site itself changed. Push is only history. If the address a visitor opens did not change, the deploy is not finished.

Advantages and limits

Deploy opens finished work to someone else. When you rush, a mistake opens too. Localhost hides a mistake, but nobody sees it. You do not have to deploy every small text at once. Open it on your own machine first. Then place it. Do not delete the old one, so you can return if the new one breaks.

Basic ideas

Localhost is a check. Push is history. Deploy is the change of the page a person opens.

  • Deploy changes the running file on hosting
  • Git push does not open the page by itself
  • An old version should stay
  • A secret key should not fall into this move

A short example

This command is an example. Your hosting may name its own command. The meaning is the same: put the file where people see it.

git push
# tarix getdi, səhifə özü dəyişməyə bilər

deploy

Common questions

  • Are deploy and git push the same? No. Push keeps history. Deploy changes the page people open. Sometimes deploy starts by itself after a push. That is a separate setting.
  • If it opened on localhost, is the site on the internet? No. Localhost is only your computer. Someone else sees it after deploy puts the file on another machine.
  • Do I have to deploy every fix at once? No. Check it on your own machine first. Place it when it is ready. Do not delete the old version.