Skip to content

Commit

Permalink
Added region option
Browse files Browse the repository at this point in the history
  • Loading branch information
AkhileshNS committed Dec 9, 2020
1 parent cdd8fc6 commit c3e8ec1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ The action comes with additional options that you can use to configure your proj
| rollbackonhealthcheckfailed | false | When set to true this will attempt to rollback to the previous release if the healthcheck fails | true or false |
| env_file | false | path to an env file (with respect to appdir) | /.env |
| justlogin | false | Set to true if you want the action to just login to Heroku and nothing else | true or false |
| region | false | The region in which you would like to deploy a server | eu or dublin |
## Examples
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ inputs:
description: "Set to true if you want the action to just login to Heroku and nothing else"
required: false
default: "false"
region:
description: "The region in which you would like to deploy a server"
required: false
default: ""
outputs:
status:
description: "The Success/Failure of the action"
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ machine git.heroku.com
password ${api_key}
EOF`;

const addRemote = ({ app_name, buildpack }) => {
const addRemote = ({ app_name, buildpack, region }) => {
try {
execSync("heroku git:remote --app " + app_name);
console.log("Added git remote heroku");
} catch (err) {
execSync(
"heroku create " +
app_name +
(buildpack ? " --buildpack " + buildpack : "")
(buildpack ? " --buildpack " + buildpack : "") +
(region ? " --region " + region : "")
);
console.log("Successfully created a new heroku app");
}
Expand Down Expand Up @@ -129,6 +130,7 @@ let heroku = {
core.getInput("rollbackonhealthcheckfailed") === "false" ? false : true,
env_file: core.getInput("env_file"),
justlogin: core.getInput("justlogin") === "false" ? false : true,
region: core.getInput("region"),
};

// Formatting
Expand Down

0 comments on commit c3e8ec1

Please sign in to comment.