Jump to content

Tehnologii Web/2022-2023/Laborator 13

From Wikiversity

Deployment with Git and Github

[edit | edit source]

The Heroku platform is accessed. A new account is created if does not already exist. A new application will be created by accessing the New button in the upper-right corner.

Click on Create new app.

The name of the application will be entered and the Create app button will be pressed. Once a new application has been created, follow the steps in the Deploy section.

Deployment using Git and Heroku CLI

[edit | edit source]

Will use command line git or a GUI tool to deploy.

  1. Will download and install Heroku CLI from the following link: https://devcenter.heroku.com/articles/heroku-cli
  2. After downloading and installing, we will open the Terminal and we will need to log in your Heroku account, if you haven't already, and follow the instructions to create a new SSH public key.
    $ heroku login
    
  3. Initialize the git repository in a new directory, or in an already existing one.
    $ cd my-project/
    $ git init
    $ heroku git:remote -a application_name
    
  4. Commit the code and upload the application to Heroku using Git.
    $ git add .
    $ git commit -am "make it better"
    $ git push heroku master
    

For the already existing Git repository, heroku git: remote will be added.

$ heroku git:remote -a application_name

Deployment using GitHub

[edit | edit source]

As a deployment method, we can use GitHub.

We will need to click the button: Connect to GitHub and login.

  1. At the Search for repository to connect section, we will need to select the repository we want to use for deployment
  2. Click Connect
  3. In the Manual deploy section, select the branch and click on the Deploy Branch button
  4. If everything worked, we can access the application.