Tehnologii Web/2022-2023/Laborator 13
Deployment with Git and Github
editThe 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
editWill use command line git or a GUI tool to deploy.
- Will download and install Heroku CLI from the following link: https://devcenter.heroku.com/articles/heroku-cli
- 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
- 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
- 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
editAs a deployment method, we can use GitHub.
We will need to click the button: Connect to GitHub and login.
- At the Search for repository to connect section, we will need to select the repository we want to use for deployment
- Click Connect
- In the Manual deploy section, select the branch and click on the Deploy Branch button
- If everything worked, we can access the application.