- create project
npm init -y npm i
- add the following lines to package.json
"engines": { "node": "8.12.0", //node version "npm": "6.4.1" //npm version }, "scripts": { "start": "node app.js", //heroku will using the following script to run node app }
create a heroku project
- select NEW → Create New Application
- set the name of the application and select a region
- click on the Create Application button
Gitlab setup creates a new repo or adds to an existing project listed on the gitlab website
create the .gitlab-ci.yml file
image: node:latest stages: - production production: type: deploy stage: production image: ruby:latest script: - apt-get update -qy - apt-get install -y ruby-dev - gem install dpl - dpl
- Setting HEROKU_API_KEY
- Setup → CI / CD → Variable → Expand
- Input variable key -> variable name in .gitlab-ci.yml
- Input Variable Value → Heroku Api Key
Get Heroku Api Key
- Heroki Dashborad → Account Settings
install runner on gitlab
- Setup → CI / CD → Variable → Expand
- Concrete runners
- Install gitlab runner
- Windows
- Linux
- MacOS
- For setup steps here
- General runners
- just click Disable shared runners to enable shared runner
shove files in gitlab it will automatically be deployed to geroku
git add .
swarup260
source share