Skip to content

Commit

Permalink
HD-9: Heroku Dyno Formation (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Carlos Taveras committed Oct 22, 2020
1 parent 7b87e8d commit 5f48abe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
app_name: ${{ secrets.HEROKU_APP_NAME }} # you aplication name
dockerfile_path: '' # set the path to the folder wher the Dokerfile is located
options: '' # Docker Build Options
formation: '' # Docker Dyno Formation. By default is web
```
| Variables | Description | Required |
Expand All @@ -31,3 +32,4 @@ jobs:
| app_name | Heroku App Name | ✅ |
| dockerfile_path | Path where your Docker File | ✅ |
| options | Docker Build Options | ❌ |
| formation | Heroku Formation (Default: `web`) | ❌ |
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
email:
description: 'Email Linked to your Heroku Account'
required: true
formation:
description: 'Heroku Dyno Formation'
default: 'web'
required: false
api_key:
description: 'Your Heroku API Key'
required: true
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ async function buildPushAndDeploy() {
const dockerFilePath = core.getInput('dockerfile_path');
const buildOptions = core.getInput('options') || '';
const herokuAction = herokuActionSetUp(appName);
const formation = core.getInput('formation');

try {
await exec(`cd ${dockerFilePath}`);

await exec(`docker build . --file Dockerfile ${buildOptions} --tag registry.heroku.com/${appName}/web`);
await exec(`docker build . --file Dockerfile ${buildOptions} --tag registry.heroku.com/${appName}/${formation}`);
console.log('Image built 🛠');

await exec(herokuAction('push'));
Expand Down

0 comments on commit 5f48abe

Please sign in to comment.