Code Monkey home page Code Monkey logo

heroku-deploy's Introduction

Heroku Deploy

Join the chat at https://gitter.im/akhileshns-heroku-deploy/community

GitHub issues GitHub Tests

This is a very simple GitHub action that allows you to deploy to Heroku. The action works by running the following commands in shell via NodeJS:-

Table of Contents

  1. Getting Started
  2. Important Note
  3. Options
  4. Examples
  5. Health Check
  6. Environment Variables
  7. Procfile Passing
  8. Deploying to a team
  9. Just Login
  10. Important Notes
  11. License

Getting Started

To get started using the action, just make sure to have a Procfile or a Dockerfile in your project and then create a folder called .github and inside it, create another folder called workflows. Finally inside the workflows folder, create a file called main.yml with the following contents:

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"

Now go to your Heroku account and go to Account Settings. Scroll to the bottom until you see API Key. Copy this key and go to your project's repository on GitHub.

In your Repo, go to Settings -> Secrets and click on "New Secret". Then enter HEROKU_API_KEY as the name and paste the copied API Key as the value.

You can now push your project to GitHub and it will be automatically deployed to Heroku henceforth.

You learn more about GitHub Secrets here and GitHub Actions here

Important Note

Please Note: Git has recently announced that it is planning to switch the default branch's name from "master" to "main". For this reason, the Action also pushes to the "main" branch in the heroku origin by default and if your Heroku App is still using the "master" branch, then the Action will automatically switch your Heroku remote to use "main" as the default branch. There is No Action Needed from you, just keep in mind that this change is occurring as you continue to use the App and if you ever need to manually deploy the App, you can do so using the following command:

git push heroku YOUR_BRANCH:refs/heads/main

Also the remote_branch property no longer exists in the latest release of the Action. If you still have this as part of the 3.10.9 release. Please remove it as it may cause problems in your workflow

Please Note: While creating a new project on Heroku, do not enable the option for Automatic Deployments as this would result in an error when the GitHub Action is triggered.

Options

The action comes with additional options that you can use to configure your project's behavior on Heroku. You can setup these options under the "with" object as presented above:

Name Required Description Example
heroku_api_key true This will be used for authentication. You can find it in your heroku homepage account settings ***
heroku_email true Email that you use with heroku [email protected]
heroku_app_name true The appname to use for deploying/updating demo-rest-api
buildpack false An optional buildpack to use when creating the heroku application https://github.com/heroku/heroku-buildpack-static.git
branch false The branch that you would like to deploy to Heroku. Defaults to "HEAD" master, dev, test
dontautocreate false Set this to true if you don't want to automatically create the Heroku app true or false
dontuseforce false Set this to true if you don't want to use --force when switching branches true or false
usedocker false Will deploy using Dockerfile in project root true or false
docker_heroku_process_type false Type of heroku process (web, worker, etc). This option only makes sense when usedocker enabled. Defaults to "web" (Thanks to singleton11 for adding this feature) web, worker
docker_build_args false A list of args to pass into the Docker build. This option only makes sense when usedocker enabled. NODE_ENV
appdir false Set if your app is located in a subdirectory api, apis/python
healthcheck false A URL to which a healthcheck is performed (checks for 200 request) https://demo-rest-api.herokuapp.com
checkstring false Value to check for when conducting healthcheck requests ok
delay false Time (in seconds) to wait before performing healthcheck. Defaults to 0 seconds 5
procfile false Contents of the Procfile to save and deploy web: npm start
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
stack false Set stack of your heroku app if you need to change. Default: heroku-20 container
team false If deploying to an organization, then specify the name of the team or organization here team-xyz

Examples

Deploy with Docker

Heroku now allows users to deploy docker containers. To use this feature, simply add a Dockerfile to your project and add a CMD command at the end of the Dockerfile. This is the command used by heroku to start the webserver inside the container. Finally make sure to set the usedocker flag to true before deploying.

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          usedocker: true

Keep in mind that if you deploy once using docker, the same heroku app is not compatible with a non-docker setup and similarly, you cannot deploy a dockerized setup to a non-docker heroku app.

If you need to pass in any ARGs for the Docker build, you may provide a list of arg names which automatically pull from the environment.

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          usedocker: true
          docker_build_args: |
            NODE_ENV
            SECRET_KEY
        env:
          NODE_ENV: production
          SECRET_KEY: ${{ secrets.MY_SECRET_KEY }}

Also, thanks to Olav Sundfør for adding the Docker feature and Matt Stavola for adding the ability to pass in build args.

Deploy with custom Buildpacks

Taken from the official heroku website:

"Heroku Buildpacks are sets of open source scripts that are used for compiling apps on Heroku. They form the backbone of Heroku’s polyglot platform. Buildpacks enable you to extend Heroku's build system to support your language or customizations, or to make particular binary packages available to the runtime. Heroku Buildpacks give you the freedom to code in the languages and frameworks that work best for your app and your team"

To use a custom buildpack in the action, simply add the url of the buildpack to the action:

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          buildpack: "https://github.com/HashNuke/heroku-buildpack-elixir.git"

Deploy Subdirectory

If you are using a complex application which has both frontend and backend applications in separate folders, you can specify a path to the directory to deploy using the appdir option:

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          appdir: "api" # <- This will point to the api folder in your project

Thanks to meszarosdezso for adding the appdir feature

Deploy custom branch

You can use the branch option to deploy an app in another branch

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          branch: "dev"

Though this is also possible to do with GitHub Actions, click here for more information

Deploy custom remote branch

You can use the remote_branch option to deploy an app to another remote branch

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          remote_branch: "main"

Though this is also possible to do with GitHub Actions, click here for more information

Set stack for your app

In some cases, you need to change the default stack - heroku-20. For example, If you are building docker images with heroku yml, you need to change the stack to container. You can use the stack option to change stack for your app.

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          stack: "container"

Though this is also possible to do with GitHub Actions, click here for more information

Health Check

Sometimes you will run into issues where the action has successfully deployed the project but because of some error in code or the like, the Heroku App crashes or fails to launch. To counter this, you can setup a healthcheck in the action:

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          healthcheck: "https://[YOUR APP's NAME].herokuapp.com/health"

Adding the url to the healthcheck option of the action will make the action attempt to perform a GET Request to that url and print the response if successful. Else it will fail the action to indicate that the deploy was not successful.

P.S: It is recommended that you setup a specific route such as /health for performing healthchecks

Advanced Usage

Additionally, if you are using a custom route for performing healthchecks, you can check for a specific value from this url using the checkstring option of the action like so:

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          healthcheck: "https://[YOUR APP's NAME].herokuapp.com/health"
          checkstring: "ok"

This will essentially check if the value returned by sending a GET request to the healthcheck url is equal to the checkstring

Adding Delay

In some cases, a healthcheck ends up being performed before the application has been setup on Heroku. To counter this, you can manually set the delay option in the action to make the action wait a certain period of time (in seconds) before performing the healthcheck

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          healthcheck: "https://[YOUR APP's NAME].herokuapp.com/health"
          checkstring: "ok"
          delay: 5

By default, the delay will be 0 if you choose to not set it

Rollback on healthcheck failure

You can set the rollbackonhealthcheckfailed option to ensure that your application is rolled back if the healthcheck fails. .github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          healthcheck: "https://[YOUR APP's NAME].herokuapp.com/health"
          checkstring: "ok"
          rollbackonhealthcheckfailed: true

By default, the application will not be rolled back if the healthcheck fails.

Thanks to FridaTveit for adding this feature

Environment Variables

Heroku offers a means of passing sensitive information to your app (such as api keys etc) via something it calls config vars which you can find in the settings of your heroku app. But sometimes you might want to store sensitive information (api keys etc) in GitHub Secrets instead just to ensure platform independence. If you choose to this, you can then pass those secrets to your heroku app by using the "env" object of the action:-

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
        env:
          HD_FIREBASE_API_KEY: ${{secrets.FIREBASE_API_KEY}}
          HD_RANDOM_DATA: "Hello"

Note that the variables must start with "HD_". This is is important so the action can tell your environment variable apart from multiple other variables (passed by your language, github actions etc) which you probably don't want sitting in your heroku app's config vars.

On that note, if you've set these variables and have deployed your app, you can check your Heroku App's config vars and you'll find that they have been set with the env variables you have passed.

PLEASE NOTE: The "HD_" will be scrapped from the variable your name by the action. So in your project, "FIREBASE_API_KEY" will be passed instead of "HD_FIREBASE_API_KEY" (for example) and you can see this if you check your Heroku App's config vars. We understand that this can be confusing but this is again to ensure Platform independence and so that you don't have to use HD_FIREBASE_API_KEY if you choose to stop using Heroku

ENV File

You can if you wish also pass the path to an env file (with respect to your appdir path) as an option to the action. The action will then read that file and set the config vars accordingly in Heroku

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          env_file: ".env"
        env:
          HD_FIREBASE_API_KEY: ${{secrets.FIREBASE_API_KEY}}
          HD_RANDOM_DATA: "Hello"

Example env file

HELLO=world
WORLD=hello

There are two important points to keep in mind when using the env_file option.

  1. The first is that in can be used in conjunction with env option of the action as you have seen above

  2. The second is that unlike in the env option, you do not need to prefix the env variables in the .env file with "HD_".

    (For those of you who are wondering why this is the case, when using the env option, the env variables are passed directly into the process along with all the other env variables passed by GitHub Actions, the language you are using etc and the "HD_" in that case is to help differentiate your env variables from them. But when using a file to pass the env variables, the action manually reads the file so there is no chance of stray env variables being passed by your language, github actions etc and hence no need to add the "HD_")

Also note that using a file (which can be named anything so long as it follows the format of a standard env file) can be useful if you're trying to send a very large number of env variables to Heroku, it does mean that keeping the .env file secure and private is entirely in your hands so tread with caution.

Procfile Passing

In some cases, you might want to be able to set the Procfile within the action itself instead of declaring it manually in your project. Although this approach is not recommended in favor of just using multiple branches, it might still be useful in some edge cases. You can set the Procfile in the action by using the procfile option of the action like so:

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
          heroku_email: "YOUR EMAIL"
          procfile: "web: npm start"

Keep in mind this won't work if you are using Docker.

Deploying to a team

If you are an enterprise user and wish to deploy your app to a specific team, you can do so by just passing the team option to the action:

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "YOUR APP's NAME"
          heroku_email: "YOUR EMAIL"
          team: "THE TEAM's NAME"

Just Login

GitHub Actions does come with the heroku cli pre-installed (this is what is used by the Action to deploy applications). So if you wish to use the heroku cli and just need to login, you can use the justlogin option of the Heroku Deploy Action

.github/workflows/main.yml

name: Deploy

on:
  push:
    branches:
      - master # Changing the branch here would also work

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected] # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: ""
          heroku_email: "YOUR EMAIL"
          justlogin: true
      - run: heroku auth:whoami

Important Notes

  • You can check this repo's .github/workflows/main.yml for example use cases of the action in use. Additionally the APIs for these use cases can be found in the tests folder of the repo

  • You can find the secrets tab in your project's settings

  • Be careful with your appname, cuz the action either deploys to an existing app or creates a new one if it doesn't exist. So if you accidently change it after deploying it once already, the action won't fail, it'll just create a new dyno and if you are on a paid plan, heroku can be expensive. On that note, always check the logs of your actions to make sure everything is A-OK.

  • If you're using the above exact workflow code, keep in mind that it deploys whenever you make a change to the master branch (Even README updates which have nothing to do with application code) and that might not be very efficient for you, have a look through the github actions docs to customize when the action should trigger.

    (I would recommend making a separate dev branch and setting up the action to trigger upon pull request to the master branch)

  • By default, if you don't specify a branch in your action, it will default to the HEAD branch (or whichever branch the action is defined under). So you might be wondering what happens if you define the same action in a different branch under the same heroku app name (or which you try to deploy to the same appname from a different branch)? The answer is that the new branch overrides whatever your old branch was (even if the new branch is behind the old branch in terms of commits unless you set dontuseforce to true)

  • For more info on how Heroku enables deployment using Docker, check out https://www.heroku.com/deploy-with-docker

License

This project is licensed under the MIT License - see the LICENSE file for details

heroku-deploy's People

Contributors

abernier avatar akhileshns avatar brtrick avatar dependabot[bot] avatar dhina17 avatar fridatveit avatar gitter-badger avatar ishaanohri avatar jakobo avatar jotamusik avatar kaltsoon avatar khromov avatar mbstavola avatar meszarosdezso avatar morrislaptop avatar olaven avatar rikeda71 avatar singleton11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

heroku-deploy's Issues

Heroku Deploy Fails to Deploy. Shows HTML error page instead

I am not sure how recent this error became but for a long time I was on 3.6.8 and today I pushed a change to my repo. Instead of a successful deploy, I checked and see it failed. This is the error (sorry for the copy & paste formatting)

I decided maybe i should upgrade to the latest heroku-deploy but I still get the same error

Run akhileshns/[email protected]
Created and wrote to ~/.netrc
 ›   Warning: Our terms of service have changed: 
 ›   https://dashboard.heroku.com/terms-of-service
Successfully logged into heroku
heroku: Press any key to open up the browser to login or q to exit:  ›   Warning: heroku update available from 7.47.11 to 7.47.12.
Error: HTTP Error 503 for GET https://api.heroku.com/apps/***
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <title>Application Error</title>
    <style media="screen">
      html,body,iframe {
        margin: 0;
        padding: 0;
      }
      html,body {
        height: 100%;
        overflow: hidden;
      }
      iframe {
        width: 100%;
        height: 100%;
        border: 0;
      }
    </style>
  </head>
  <body>
    <iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
  </body>
</html>
    at APIHTTPClient._request (/usr/lib/heroku/node_modules/@heroku-cli/command/node_modules/http-call/lib/http.js:215:19)
    at async Function.request (/usr/lib/heroku/node_modules/@heroku-cli/command/node_modules/http-call/lib/http.js:162:9)
    at async Function.request (/usr/lib/heroku/node_modules/@heroku-cli/command/lib/api-client.js:87:38)
    at async GitRemote.run (/usr/lib/heroku/node_modules/@heroku-cli/plugin-git/lib/commands/git/remote.js:14:31)
    at async GitRemote._run (/usr/lib/heroku/node_modules/@oclif/command/lib/command.js:44:20)
    at async Config.runCommand (/usr/lib/heroku/node_modules/@oclif/config/lib/config.js:151:9)
    at async Main.run (/usr/lib/heroku/node_modules/@oclif/command/lib/main.js:21:9)
    at async Main._run (/usr/lib/heroku/node_modules/@oclif/command/lib/command.js:44:20)
 ›   Warning: heroku update available from 7.47.11 to 7.47.12.
Creating ***... !
 ▸    Expected response to be successful, got 503
Error: Error: Command failed: heroku create ***
 ›   Warning: heroku update available from 7.47.11 to 7.47.12.
Creating ***... !
 ▸    Expected response to be successful, got 503

Is this on my end or Heroku's end?

heroku: not found

I’m trying to use heroku-deploy. My build fails because heroku is not found. My understanding is that the heroku-cli is preinstalled.

/bin/sh: 1: heroku: not found
Error: Error: Command failed: heroku login

I uninstalled heroku-cli then installed heroku globally via npm. That didn’t work. Then I tried adding heroku to my package.json. That didn’t work.

Any suggestions are greatly appreciated. Thank you.

Silent failure?

Hello there! First of all, kudos because this is a great piece of software.

I've used it succesfully to deploy a Streamlit soundboard which you can find here. My problem is that Heroku app doesn't seem to be deployed anymore. You can my latest build trace here. Here is the associated workflow as well as the app directory.

Any clues?

Edit files before pushing/deploy

Olá! 🤙

I have to edit some files before pushing to Heroku and I need to push these edited files.

The action goes well (no errors), but the files pushed still there and not changed...

Am I missing something? 🤔

Here's my action:

name: CI - Production

on:
  push:
    branches: [ production ]

jobs:
  deploy_to_production:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Removing Docker
        run: |
          rm -f docker-compose.yml
          rm -f Dockerfile

      - name: Writing credentials
        run: |
          echo "${{ secrets.PRODUCTION_MASTER_KEY }}" > ./config/master.key
          echo "${{ secrets.PRODUCTION_CREDENTIALS }}" > ./config/credentials.yml.enc

      - name: Pushing to production
        uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{ secrets.PRODUCTION_HEROKU_API_KEY }}
          heroku_app_name: ${{ secrets.PRODUCTION_HEROKU_APP_NAME }}
          heroku_email: ${{ secrets.PRODUCTION_HEROKU_EMAIL }}

New file added in workflow runtime is not deployed

Considering my workflow file:

name: Heroku CI - CD

on:
  push:
    branches: [ master ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-go@v1
        with:
          go-version: '1.14.6'
      - run: cd src && go mod vendor
      - name: create-json
        id: create-json
        uses: jsdaniell/[email protected]
        with:
          name: "devdatatools-firebase-adminsdk.json"
          object: ${{ secrets.CREDENTIALS_OBJECT }}
          dir: "src/"
      - run: cd src && git config --global user.email "[email protected]" && git config --global user.name "jsdaniell" && git add . && git commit -a -m "Deploy Heroku Commit"
      - run: cd src && ls
      - uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
          heroku_app_name: "dev-data-tools-api-golang"
          heroku_email: "[email protected]"
          appdir: "src"

The problem is that, the file devdatatools-firebase-adminsdk.json was created and commited but is ignored on the heroku deployed, as if was not created, but on cd src && ls the file was there, there's not gitignore on my src repo so this is not the problem. I would like to understand how works the heroku action on my src folder.

Healthcheck doesnt accept env vars

I have this configuration:

          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: ${HEROKU_APP_NAME}
          heroku_email: ${{secrets.HEROKU_EMAIL}}
          usedocker: true
          healthcheck: ${HEROKU_APP_HC}
          checkstring: ok
          delay: 10
          rollbackonhealthcheckfailed: true

while heroku_app_name and other vars accept an env var, healthcheck doesn't and fails

Deployment failed due to: 'Push rejected, cannot delete master branch'

To preface im very new to heroku, it is my first time using it for a project.

I'm trying to publish a node app to heroku, the usefull parts of my main.yml can be found below;

When built my app ends up in a folder in the root called 'build'. So im using the appdir parameter of the heroku-deploy.

name: CI

on: [push]

jobs:
  build:
    name: Build
    runs-on: ubuntu-18.04
    strategy:
      matrix:
        node-version: [14]

    steps:
      - uses: actions/checkout@v1
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node_version: ${{ matrix.node-version }}

      - name: Setup
        run: |
          mkdir -p build/public
      
      <build steps here>

      - name: Deploy to Heroku
        uses: AkhileshNS/[email protected]
        with:
          heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
          heroku_email: ${{ secrets.HEROKU_EMAIL }}
          heroku_app_name: battlographer
          buildpack: heroku/nodejs
          appdir: build

Now when i run my action i get the following error message/logs at the deploy stage

##[group]Run AkhileshNS/[email protected]
with:
  heroku_api_key: ***
  heroku_email: ***
  heroku_app_name: ***
  buildpack: heroku/nodejs
  appdir: build
  branch: HEAD
  dontuseforce: false
  usedocker: false
  docker_heroku_process_type: web
  delay: 0
##[endgroup]
Created and wrote to ~/.netrc
Successfully logged into heroku
Added git remote heroku
heroku: Press any key to open up the browser to login or q to exit: 1/66 (0) [0]
2/66 (1) [0]
...
66/66 (65) [0]
No new revisions were found
remote: 
remote: !	Push rejected, cannot delete master branch        
remote: 
To https://git.heroku.com/***.git
 ! [remote rejected] master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'

            Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch. 
            (If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml. 
            Specifically, the error was: Error: Command failed: git push  heroku `git subtree split --prefix=build HEAD`:refs/heads/master
1/66 (0) [0]
...
66/66 (65) [0]
No new revisions were found
remote: 
remote: !	Push rejected, cannot delete master branch        
remote: 
To https://git.heroku.com/***.git
 ! [remote rejected] master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'

        
1/66 (0) [0]
...
48/66 (47) [0]
##[error]Error: Command failed: git push --force heroku `git subtree split --prefix=build HEAD`:refs/heads/master
1/66 (0) [0]
...
66/66 (65) [0]
No new revisions were found
remote: 
remote: !	Push rejected, cannot delete master branch        
remote: 
To https://git.heroku.com/***.git
 ! [remote rejected] master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'

49/66 (48) [0]
...
66/66 (65) [0]
No new revisions were found
remote: 
remote: !	Push rejected, cannot delete master branch        
remote: 
To https://git.heroku.com/***.git
 ! [remote rejected] master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'

Any idea whats going on here?

From some googling it looks like maybe it could be a login issue with heroku, or possibly an issue with remote branch creation.

fatal: Couldn't find remote ref master

Hello,

when trying to deploy, I'm falling into this error:
Captura de Tela 2021-02-08 às 14 48 49

Environment:

  • I was already deploying automatically via heroku's hook to Github (connect to GitHub)
  • The deploy was being configured by the "test" branch (not a main branch)

Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch.

Hi. First of all, thanks for your work. It is becoming an easy-going and straightforward tool to use inside the actions.

But for two days I'm getting this error in my deploy action. The branches in Heroku are pretty clean and I can use it normally in my local environment, pushing to Heroku. It also works in the Travis CI.

Don't mind the open Postgres user and pass. It will be changed and moved to secrets and my test database has no secrets to the outside world.

Pay attention, please, on the "staging deploy" since the "production deploy" has some attempts I've made within these two days.

What am I missing?

I'll appreciate any help.

Thanks

Config file:

name: FlowClimateBuild
on: [push]

jobs:
  linters:
    name: Linters
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7.1
      - name: Ruby gem cache
        uses: actions/cache@v1
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-
      - name: Install gems
        run: |
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3
      - name: Run linters
        run: |
          bundle exec rubocop --parallel

  tests:
    name: Tests
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:12
        env:
          POSTGRES_DB: flowcontrol_test
          POSTGRES_USER: "postgres"
          POSTGRES_PASSWORD: "postgres"
        ports:
          - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7.1
      - name: Ruby gem cache
        uses: actions/cache@v1
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-
      - name: Install gems
        run: |
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3

      - name: Setup test database
        env:
          RAILS_ENV: test
          PG_HOST: localhost
          PG_USER: ""
          PG_PASSWORD: ""
          PG_PORT: ${{ job.services.postgres.ports['5432'] }}
        run: |
          bundle exec rails db:setup

      - name: Run tests
        run: bundle exec rspec
        env:
          secret_key_32_encoded: "8L+WeHTWhNtEAvQzoRaYqYtl4VCwDMReh2SzicO/iCA=\n"

  deploy-staging:
    runs-on: ubuntu-latest
    #    needs: [linters, tests]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "flowclimatestaging"
          heroku_email: "[email protected]"

  deploy-prd:
    runs-on: ubuntu-latest
    #    needs: [linters, tests]
    if: github.ref == 'refs/heads/master'
    steps:
      - uses: actions/checkout@v2
      - name: Staging deploy
        run: |
          git push -f https://heroku:${{ secrets.HEROKU_API_TOKEN }}@git.heroku.com/flowclimateapp.git origin/develop:master

Complete error message:

Created and wrote to ~/.netrc
Successfully logged into heroku
heroku: Press any key to open up the browser to login or q to exit:  ›   Warning: heroku update available from 7.43.0 to 7.43.2.
Added git remote heroku
heroku: Press any key to open up the browser to login or q to exit: fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

            Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch. 
            (If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml. 
            Specifically, the error was: Error: Command failed: git push heroku HEAD:refs/heads/master 
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

        
fatal: 'heroku' does not appear to be a git repository
Error: Error: Command failed: git push heroku HEAD:refs/heads/master --force
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Error: Specify branch on deploy

I guess that is better if in this case, we can choose which branch to push to follow the Heroku doc.

execSync(`git push heroku ${branch}:refs/heads/master ${force}`);

https://help.heroku.com/O0EXQZTA/how-do-i-switch-branches-from-master-to-main

I have a repository that doesn't have a branch master, when I'm trying to deploy I'm receiving this error.

fatal: ambiguous argument 'dev': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
remote: 
remote: !	Push rejected, cannot delete master branch        
remote: 
To https://git.heroku.com/myapp.git
 ! [remote rejected] master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'
Error: Error: Command failed: git push --force heroku `git subtree split --prefix=src dev`:refs/heads/master
fatal: ambiguous argument 'dev': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
remote: 
remote: !	Push rejected, cannot delete master branch        
remote: 
To https://git.heroku.com/myapp.git
 ! [remote rejected] master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'

Error: Command failed: heroku login

Hi, hope you're having a good weekend!

I am currently getting this error:

Created and wrote to ~/.netrc
 ›   Warning: Our terms of service have changed: 
 ›   https://dashboard.heroku.com/terms-of-service
Error: Error: Command failed: heroku login
 ›   Warning: Our terms of service have changed: 
 ›   https://dashboard.heroku.com/terms-of-service
 ›   Error: Cannot log in with HEROKU_API_KEY set

 ›   Error: Cannot log in with HEROKU_API_KEY set

I have double and tripple checked my heroku_api_key , heroku_app_name and heroku_email and they are all correct. Was there a change to how the heroku api works recently?

Below is my config:

      - name: Deploy Production
        uses: akhileshns/[email protected] # This is the action
        if: contains(github.ref, 'main')
        with:
          heroku_api_key: ${{ env.HEROKU_API_KEY }}
          heroku_app_name: ${{ env.HEROKU_APP_NAME_PRODUCTION }}
          heroku_email: ${{ env.HEROKU_EMAIL }}
          healthcheck: ${{ env.HEROKU_HEALTH_CHECK_URL_PRODUCTION }}
          checkstring: 'ok'
          rollbackonhealthcheckfailed: true

Build Log

Hey,

I would love if the actions commented the build log directly on the commit itself.

Nico

App located in subdirectory

When using your action I get

remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz        
remote:                
remote:  !     ERROR: Application not supported by 'heroku/nodejs' buildpack        
remote:  !             
remote:  !     The 'heroku/nodejs' buildpack is set on this application, but was        
remote:  !     unable to detect a Node.js codebase.        
remote:  !                 
remote:  !     A Node.js app on Heroku requires a 'package.json' at the root of        
remote:  !     the directory structure. 

because my NodeJS app is in a API folder.

Is there anyway to use git push subtree with this action?

Thanks in advance.

Error on pushing to heroku

I'm using this action and I have the following error message while the aciton tries to push to heroku.

remote: !	Push rejected, source repository is a shallow clone. Unshallow it with `git fetch --all --unshallow` and try pushing again.
remote:
To https://git.heroku.com/laborsord.git
 ! [remote rejected] HEAD -> master (shallow update not allowed)
error: failed to push some refs to 'https://git.heroku.com/laborsord.git'
##[error]Error: Command failed: git push heroku HEAD:refs/heads/master

Gh action step indicates success despite heroku release phase command failed

Hey, first of all, thank you very much for this well documented action.
I setup a GitHub workflow with "[email protected]". That worked fine. Now I extended my Procfile with a release command for database migration and noticed that the GitHub workflow indicates success even though the release command failed.

Is it possible to adapt the heroku-deploy action in a way that it reflects the failed release phase?

One example of a failed release:
Step indicates success but should indicate failure instead:
image

Extract from the GitHub Action log of this step:
image
image

Heroku CLI status:
image

Step definition:
image

Procfile passing not working

The feature Procfile passing is not working because when you are doing this

const createProcfile = ({ procfile, appdir }) => {
  if (procfile) {
    fs.writeFileSync(path.join(appdir, "Procfile"), procfile);
    execSync(`git add -A && git commit -m "Added Procfile"`); // <- Here
    console.log("Written Procfile with custom configuration");
  }
};

There is no git account defined so it fails to commit

A solution may be like this...

const createProcfile = ({ procfile, appdir }) => {
  if (procfile) {
    fs.writeFileSync(path.join(appdir, "Procfile"), procfile);
    execSync(`git config user.name "Autodeploy Heroku Action"`);
    execSync(`git config user.email "${email}"`);
    execSync(`git add -A && git commit -m "Added Procfile"`); // <- Here
    console.log("Written Procfile with custom configuration");
  }
};

I already tested it and works without any problem because the commit is local only...

'heroku' does not appear to be a git repository

Hi,

I get this error but I have no idea why. I don't use heroku branch anywhere I just want to deploy my master branch.
Could you please have a look if it's something I miss or a real issue?

--->

  • [new branch] YYY -> YYY
  • [new tag] v1.0.0 -> v1.0.0
    Created and wrote to ~/.netrc
    Successfully logged into heroku
    heroku: Press any key to open up the browser to login or q to exit: › Warning: heroku update available from 7.42.6 to 7.42.8.
    Added git remote heroku
    heroku: Press any key to open up the browser to login or q to exit: fatal: 'heroku' does not appear to be a git repository
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.
    Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch.
    (If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml.
    Specifically, the error was: Error: Command failed: git push heroku master:refs/heads/master
    fatal: 'heroku' does not appear to be a git repository
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists. <---

My workflow file:
--->
name: Heroku deploy
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "XXX-heroku"
branch: "master"
dontuseforce: 1 <---

Is it possible to deploy docker from github packages or any other docker registry?

In my project i publish a docker image to github packages (githubs docker registry) using the docker/build-push-action@v1 action because i need it to be published there anyway. Currently my github actions pipeline builds the docker image a second time when using the heroku deploy action for docker, which looks a bit redundant to me in that case.

is it possibile to just pass a docker image name?

this would also be handy if you just want to deploy some docker image to heroku that you are not maintaining yourself

[Feature request] post-deploy Health check

First, I'd like to say thank you to all the collaborators involved in making this Github Action. 🙏

I think a great feature would be to do a quick health check to verify that a provided endpoint returns GET 200 OK otherwise fail the build.

It would be great if this could be optionally configured at the action level in the yaml file alongside the other with variables.

This feature would address the case that the code deploys correctly but the application does not start.

This feature would not address the case that the code fails to deploy due to a git error as it would stop a build attempt since the code didn't get updated, so the issue described here would be a separate issue.

Here's an example ideal usage:

name: Deploy to Heroku

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest

    - uses: actions/checkout@v2
    - uses: AkhileshNS/[email protected]
      with:
        heroku_api_key: ${{secrets.HEROKU_API_KEY}}
        heroku_app_name: ${{secrets.HEROKU_APP_NAME}}
        heroku_email: ${{secrets.HEROKU_EMAIL}}
        health_check: https://example.herokuapp.com/health   # 👈🙏

By default, the Application error screen returns 503.

Screenshot 2020-07-02 at 3 04 29 PM

Screenshot 2020-07-02 at 3 04 25 PM

Missing files on push?

Hi there!

I'm pretty sure this is not an issue, but I'm a trully lost on GitHub Actions and the Heroku deploy pipeline.

I built a main.yml workflow which goes like

name: CI_COMPILE_DEPLOY_HEROKU

on:
  push:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run compile-web.sh
        run: sh ./compile-web.sh

      - uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "myHerokuAppName"
          heroku_email: "[email protected]"

The compile-web.sh file builds an application which is in a subfolder. After it's execution new folders and files are created, the important file is.
(Repository)/myApp/target/myApp.jar

In the repository's root there's a Procfile so Heroku knows where to find the compiled file. Goes like this.
java $JAVA_OPTS -jar myApp/target/myApp.jar $JAR_OPTS

In the Actions output i can see the build and deploy process ends well, and Heroku gets notified of the change, but it fails with an error:
app[web.1]: Error: Unable to access jarfile myApp/target/myApp.jar

On my PC I execute heroku run bash followed by ls myApp/ and not even the myApp/target/ folder exists.

Is this an expected behavior? If so, is there a way I can add the mentioned jar file in the heroku push?

Thanks in advance!

Buildback isn't detected

Hey there. Great work on making this. I tried it out and it says that no buildpack is detected, although I have set the buildpack parameter in the GitHub workflow. Any insight on this?

How I can force push or pull before deploy, rejected error

I'm trying to deploy my golang application to heroku, all works fine in local, actually I have a shellscript file like these:

go mod vendor
git add .
git commit -a -m "Updated heroku"
git push heroku master
cd ../

This file is not used on action, is how I deploy locally, only for example.

The folder of heroku repo is in an subfolder called src and here is my .yml file for action

name: Heroku CI - CD

on:
  push:
    branches: [ master ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-go@v1
        with:
          go-version: '1.14.6'
      - run: cd src && go mod vendor
      - run: cd src && git config --global user.email "[email protected]" && git config --global user.name "jsdaniell" && git add . && git commit -a -m "Deploy Heroku Commit"
      - uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
          heroku_app_name: "dev-data-tools-api-golang"
          heroku_email: "[email protected]"
          appdir: "src"
          branch: "master"

There's no difference, before this I also try in this way:

name: Heroku CI - CD

on:
  push:
    branches: [ master ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-go@v1
        with:
          go-version: '1.14.6'
      - run: cd src && go mod vendor
      - uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
          heroku_app_name: "dev-data-tools-api-golang"
          heroku_email: "[email protected]"
          appdir: "src"
          branch: "master"

In my local computer, all is fine no errors, but in action I get the error:

2020-08-28T13:53:11.0069911Z To https://git.heroku.com/dev-data-tools-api-golang.git
2020-08-28T13:53:11.0070694Z  ! [rejected]        5c29d72eb2e3527ba7345ff73dc900bba76b4b6a -> master (fetch first)
2020-08-28T13:53:11.0071356Z error: failed to push some refs to 'https://git.heroku.com/dev-data-tools-api-golang.git'
2020-08-28T13:53:11.0071832Z hint: Updates were rejected because the remote contains work that you do
2020-08-28T13:53:11.0072513Z hint: not have locally. This is usually caused by another repository pushing
2020-08-28T13:53:11.0072935Z hint: to the same ref. You may want to first integrate the remote changes
2020-08-28T13:53:11.0073516Z hint: (e.g., 'git pull ...') before pushing again.
2020-08-28T13:53:11.0074134Z hint: See the 'Note about fast-forwards' in 'git push --help' for details.
2020-08-28T13:53:11.0074663Z 
2020-08-28T13:53:11.0075402Z             Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch. 
2020-08-28T13:53:11.0075929Z             (If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml. 
2020-08-28T13:53:11.0077403Z             Specifically, the error was: Error: Command failed: git push  heroku `git subtree split --prefix=src master`:refs/heads/master
2020-08-28T13:53:11.0077783Z 1/48 (0) [0]
2020-08-28T13:53:11.0078051Z 2/48 (1) [0]
2020-08-28T13:53:11.0078324Z 3/48 (2) [0]
2020-08-28T13:53:11.0078583Z 4/48 (3) [0]
2020-08-28T13:53:11.0078840Z 5/48 (4) [0]
2020-08-28T13:53:11.0079081Z 6/48 (5) [0]
2020-08-28T13:53:11.0079337Z 6/48 (6) [1]
2020-08-28T13:53:11.0079591Z 6/48 (6) [2]
2020-08-28T13:53:11.0079846Z 7/48 (6) [2]
2020-08-28T13:53:11.0080098Z 8/48 (7) [2]
2020-08-28T13:53:11.0080347Z 9/48 (8) [2]
2020-08-28T13:53:11.0080602Z 10/48 (9) [2]
2020-08-28T13:53:11.0080862Z 11/48 (10) [2]
2020-08-28T13:53:11.0081122Z 12/48 (11) [2]
2020-08-28T13:53:11.0081380Z 13/48 (12) [2]
2020-08-28T13:53:11.0081632Z 14/48 (13) [2]
2020-08-28T13:53:11.0081884Z 15/48 (14) [2]
2020-08-28T13:53:11.0082138Z 16/48 (15) [2]
2020-08-28T13:53:11.0082396Z 17/48 (16) [2]
2020-08-28T13:53:11.0082647Z 18/48 (17) [2]
2020-08-28T13:53:11.0083551Z 19/48 (18) [2]
2020-08-28T13:53:11.0083929Z 20/48 (19) [2]
2020-08-28T13:53:11.0084189Z 20/48 (20) [3]
2020-08-28T13:53:11.0084445Z 20/48 (20) [4]
2020-08-28T13:53:11.0084698Z 21/48 (20) [4]
2020-08-28T13:53:11.0084952Z 22/48 (21) [4]
2020-08-28T13:53:11.0085235Z 23/48 (22) [4]
2020-08-28T13:53:11.0085484Z 24/48 (23) [4]
2020-08-28T13:53:11.0085768Z 25/48 (24) [4]
2020-08-28T13:53:11.0086019Z 26/48 (25) [4]
2020-08-28T13:53:11.0086250Z 27/48 (26) [4]
2020-08-28T13:53:11.0086502Z 28/48 (27) [4]
2020-08-28T13:53:11.0086751Z 29/48 (28) [4]
2020-08-28T13:53:11.0087002Z 30/48 (29) [4]
2020-08-28T13:53:11.0087247Z 31/48 (30) [4]
2020-08-28T13:53:11.0087509Z 32/48 (31) [4]
2020-08-28T13:53:11.0087784Z 33/48 (32) [4]
2020-08-28T13:53:11.0088029Z 34/48 (33) [4]
2020-08-28T13:53:11.0088346Z 35/48 (34) [4]
2020-08-28T13:53:11.0088593Z 36/48 (35) [4]
2020-08-28T13:53:11.0088839Z 37/48 (36) [4]
2020-08-28T13:53:11.0089084Z 38/48 (37) [4]
2020-08-28T13:53:11.0089315Z 39/48 (38) [4]
2020-08-28T13:53:11.0089561Z 40/48 (39) [4]
2020-08-28T13:53:11.0089814Z 41/48 (40) [4]
2020-08-28T13:53:11.0090063Z 42/48 (41) [4]
2020-08-28T13:53:11.0090382Z 43/48 (42) [4]
2020-08-28T13:53:11.0090629Z 44/48 (43) [4]
2020-08-28T13:53:11.0090877Z 45/48 (44) [4]
2020-08-28T13:53:11.0091133Z 46/48 (45) [4]
2020-08-28T13:53:11.0091378Z 47/48 (46) [4]
2020-08-28T13:53:11.0091624Z 48/48 (47) [4]
2020-08-28T13:53:11.0092637Z To https://git.heroku.com/dev-data-tools-api-golang.git
2020-08-28T13:53:11.0093521Z  ! [rejected]        5c29d72eb2e3527ba7345ff73dc900bba76b4b6a -> master (fetch first)
2020-08-28T13:53:11.0094293Z error: failed to push some refs to 'https://git.heroku.com/dev-data-tools-api-golang.git'
2020-08-28T13:53:11.0094760Z hint: Updates were rejected because the remote contains work that you do
2020-08-28T13:53:11.0095155Z hint: not have locally. This is usually caused by another repository pushing
2020-08-28T13:53:11.0095556Z hint: to the same ref. You may want to first integrate the remote changes
2020-08-28T13:53:11.0096206Z hint: (e.g., 'git pull ...') before pushing again.
2020-08-28T13:53:11.0096913Z hint: See the 'Note about fast-forwards' in 'git push --help' for details.
2020-08-28T13:53:11.0097107Z 
2020-08-28T13:53:11.0097357Z         
2020-08-28T13:54:32.6827670Z 1/48 (0) [0]
2020-08-28T13:54:32.6828214Z 2/48 (1) [0]
2020-08-28T13:54:32.6828511Z 3/48 (2) [0]
2020-08-28T13:54:32.6829149Z 4/48 (3) [0]
2020-08-28T13:54:32.6829418Z 5/48 (4) [0]
2020-08-28T13:54:32.6829678Z 6/48 (5) [0]
2020-08-28T13:54:32.6829934Z 6/48 (6) [1]
2020-08-28T13:54:32.6830190Z 6/48 (6) [2]
2020-08-28T13:54:32.6830448Z 7/48 (6) [2]
2020-08-28T13:54:32.6830702Z 8/48 (7) [2]
2020-08-28T13:54:32.6831222Z 9/48 (8) [2]
2020-08-28T13:54:32.6831522Z 10/48 (9) [2]
2020-08-28T13:54:32.6831820Z 11/48 (10) [2]
2020-08-28T13:54:32.6832081Z 12/48 (11) [2]
2020-08-28T13:54:32.6832326Z 13/48 (12) [2]
2020-08-28T13:54:32.6832602Z 14/48 (13) [2]
2020-08-28T13:54:32.6832841Z 15/48 (14) [2]
2020-08-28T13:54:32.6833118Z 16/48 (15) [2]
2020-08-28T13:54:32.6833356Z 17/48 (16) [2]
2020-08-28T13:54:32.6833629Z 18/48 (17) [2]
2020-08-28T13:54:32.6833874Z 19/48 (18) [2]
2020-08-28T13:54:32.6834144Z 20/48 (19) [2]
2020-08-28T13:54:32.6834390Z 20/48 (20) [3]
2020-08-28T13:54:32.6834661Z 20/48 (20) [4]
2020-08-28T13:54:32.6834911Z 21/48 (20) [4]
2020-08-28T13:54:32.6835179Z 22/48 (21) [4]
2020-08-28T13:54:32.6835422Z 23/48 (22) [4]
2020-08-28T13:54:32.6835692Z 24/48 (23) [4]
2020-08-28T13:54:32.6835933Z 25/48 (24) [4]
2020-08-28T13:54:32.6836203Z 26/48 (25) [4]
2020-08-28T13:54:32.6836443Z 27/48 (26) [4]
2020-08-28T13:54:32.6836711Z 28/48 (27) [4]
2020-08-28T13:54:32.6836952Z 29/48 (28) [4]
2020-08-28T13:54:32.6837209Z 30/48 (29) [4]
2020-08-28T13:54:32.6837476Z 31/48 (30) [4]
2020-08-28T13:54:32.6837734Z 32/48 (31) [4]
2020-08-28T13:54:32.6837991Z 33/48 (32) [4]
2020-08-28T13:54:32.6838245Z 34/48 (33) [4]
2020-08-28T13:54:32.6838503Z 35/48 (34) [4]
2020-08-28T13:54:32.6838756Z 36/48 (35) [4]
2020-08-28T13:54:32.6839011Z 37/48 (36) [4]
2020-08-28T13:54:32.6839283Z 38/48 (37) [4]
2020-08-28T13:54:32.6839522Z 39/48 (38) [4]
2020-08-28T13:54:32.6839794Z 40/48 (39) [4]
2020-08-28T13:54:32.6840040Z 41/48 (40) [4]
2020-08-28T13:54:32.6840308Z 42/48 (41) [4]
2020-08-28T13:54:32.6840548Z 43/48 (42) [4]
2020-08-28T13:54:32.6840823Z 44/48 (43) [4]
2020-08-28T13:54:32.6841064Z 45/48 (44) [4]
2020-08-28T13:54:32.6841330Z 46/48 (45) [4]
2020-08-28T13:54:32.6841571Z 47/48 (46) [4]
2020-08-28T13:54:32.6841841Z 48/48 (47) [4]
2020-08-28T13:54:32.6842137Z remote: Compressing source files... done.        
2020-08-28T13:54:32.6842446Z remote: Building source:        
2020-08-28T13:54:32.6842698Z remote: 
2020-08-28T13:54:32.6843648Z remote: -----> Go app detected        
2020-08-28T13:54:32.6844253Z remote: -----> Fetching stdlib.sh.v8... done        
2020-08-28T13:54:32.6844702Z remote: ----->         
2020-08-28T13:54:32.6845241Z remote: �[1;32m       Detected go modules via go.mod�[0m        
2020-08-28T13:54:32.6845675Z remote: ----->         
2020-08-28T13:54:32.6846221Z remote: �[1;32m       Detected Module Name: github.com/jsdaniell/devdata-tools-api-golang�[0m        
2020-08-28T13:54:32.6846699Z remote: ----->         
2020-08-28T13:54:32.6847277Z remote: �[1;33m !!    The go.mod file for this project does not specify a Go version�[0m        
2020-08-28T13:54:32.6847745Z remote: �[1;33m !!    �[0m        
2020-08-28T13:54:32.6848251Z remote: �[1;33m !!    Defaulting to go1.12.17�[0m        
2020-08-28T13:54:32.6848735Z remote: �[1;33m !!    �[0m        
2020-08-28T13:54:32.6849954Z remote: �[1;33m !!    For more details see: https://devcenter.heroku.com/articles/go-apps-with-modules#build-configuration�[0m        
2020-08-28T13:54:32.6852789Z remote: �[1;33m !!    �[0m        
2020-08-28T13:54:32.6853323Z remote: -----> Using go1.12.17        
2020-08-28T13:54:32.6853821Z remote: -----> Determining packages to install        
2020-08-28T13:54:32.6854283Z remote: �[1;32m       �[0m        
2020-08-28T13:54:32.6854830Z remote: �[1;32m       Detected the following main packages to install:�[0m        
2020-08-28T13:54:32.6855397Z remote: �[1;32m       		github.com/jsdaniell/devdata-tools-api-golang�[0m        
2020-08-28T13:54:32.6856694Z remote: �[1;32m       �[0m        
2020-08-28T13:54:32.6857305Z remote: -----> Running: go install -v -tags heroku -mod=vendor github.com/jsdaniell/devdata-tools-api-golang         
2020-08-28T13:54:32.6858084Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/models        
2020-08-28T13:54:32.6867582Z remote: google.golang.org/protobuf/internal/detrand        
2020-08-28T13:54:32.6868184Z remote: github.com/gorilla/mux        
2020-08-28T13:54:32.6868588Z remote: google.golang.org/protobuf/internal/errors        
2020-08-28T13:54:32.6869242Z remote: google.golang.org/protobuf/encoding/protowire        
2020-08-28T13:54:32.6869460Z remote: google.golang.org/protobuf/internal/pragma        
2020-08-28T13:54:32.6869669Z remote: google.golang.org/protobuf/reflect/protoreflect        
2020-08-28T13:54:32.6870000Z remote: google.golang.org/protobuf/internal/flags        
2020-08-28T13:54:32.6870190Z remote: google.golang.org/protobuf/internal/set        
2020-08-28T13:54:32.6870367Z remote: google.golang.org/protobuf/internal/version        
2020-08-28T13:54:32.6870554Z remote: golang.org/x/net/internal/timeseries        
2020-08-28T13:54:32.6870756Z remote: golang.org/x/net/trace        
2020-08-28T13:54:32.6870951Z remote: google.golang.org/protobuf/reflect/protoregistry        
2020-08-28T13:54:32.6871153Z remote: google.golang.org/protobuf/internal/encoding/messageset        
2020-08-28T13:54:32.6871348Z remote: google.golang.org/protobuf/internal/strs        
2020-08-28T13:54:32.6871542Z remote: google.golang.org/protobuf/internal/encoding/text        
2020-08-28T13:54:32.6871738Z remote: google.golang.org/protobuf/internal/genid        
2020-08-28T13:54:32.6871926Z remote: google.golang.org/protobuf/internal/mapsort        
2020-08-28T13:54:32.6872118Z remote: google.golang.org/protobuf/internal/fieldsort        
2020-08-28T13:54:32.6872309Z remote: google.golang.org/protobuf/runtime/protoiface        
2020-08-28T13:54:32.6872489Z remote: google.golang.org/protobuf/proto        
2020-08-28T13:54:32.6872679Z remote: google.golang.org/protobuf/internal/descfmt        
2020-08-28T13:54:32.6872867Z remote: google.golang.org/protobuf/internal/descopts        
2020-08-28T13:54:32.6873069Z remote: google.golang.org/protobuf/internal/encoding/defval        
2020-08-28T13:54:32.6873251Z remote: google.golang.org/grpc/backoff        
2020-08-28T13:54:32.6873434Z remote: google.golang.org/grpc/internal/grpclog        
2020-08-28T13:54:32.6873616Z remote: google.golang.org/grpc/grpclog        
2020-08-28T13:54:32.6873802Z remote: google.golang.org/protobuf/encoding/prototext        
2020-08-28T13:54:32.6873985Z remote: google.golang.org/protobuf/internal/filedesc        
2020-08-28T13:54:32.6874165Z remote: google.golang.org/grpc/connectivity        
2020-08-28T13:54:32.6874344Z remote: google.golang.org/grpc/attributes        
2020-08-28T13:54:32.6874534Z remote: google.golang.org/grpc/credentials/internal        
2020-08-28T13:54:32.6874716Z remote: google.golang.org/grpc/serviceconfig        
2020-08-28T13:54:32.6874893Z remote: google.golang.org/grpc/internal        
2020-08-28T13:54:32.6875078Z remote: google.golang.org/grpc/internal/credentials        
2020-08-28T13:54:32.6875259Z remote: google.golang.org/grpc/metadata        
2020-08-28T13:54:32.6875443Z remote: google.golang.org/grpc/internal/grpcrand        
2020-08-28T13:54:32.6875618Z remote: google.golang.org/grpc/codes        
2020-08-28T13:54:32.6875792Z remote: google.golang.org/grpc/encoding        
2020-08-28T13:54:32.6875974Z remote: google.golang.org/grpc/internal/backoff        
2020-08-28T13:54:32.6876168Z remote: google.golang.org/grpc/internal/balancerload        
2020-08-28T13:54:32.6876362Z remote: google.golang.org/protobuf/internal/encoding/tag        
2020-08-28T13:54:32.6876549Z remote: google.golang.org/grpc/internal/buffer        
2020-08-28T13:54:32.6876734Z remote: golang.org/x/sys/internal/unsafeheader        
2020-08-28T13:54:32.6876900Z remote: golang.org/x/sys/unix        
2020-08-28T13:54:32.6877081Z remote: google.golang.org/protobuf/internal/impl        
2020-08-28T13:54:32.6877254Z remote: google.golang.org/grpc/internal/envconfig        
2020-08-28T13:54:32.6877571Z remote: google.golang.org/grpc/internal/grpcsync        
2020-08-28T13:54:32.6877747Z remote: golang.org/x/text/transform        
2020-08-28T13:54:32.6877924Z remote: golang.org/x/text/unicode/bidi        
2020-08-28T13:54:32.6878104Z remote: golang.org/x/text/secure/bidirule        
2020-08-28T13:54:32.6878277Z remote: golang.org/x/text/unicode/norm        
2020-08-28T13:54:32.6878505Z remote: golang.org/x/net/idna        
2020-08-28T13:54:32.6878691Z remote: golang.org/x/net/http/httpguts        
2020-08-28T13:54:32.6878914Z remote: golang.org/x/net/http2/hpack        
2020-08-28T13:54:32.6879090Z remote: google.golang.org/protobuf/internal/filetype        
2020-08-28T13:54:32.6879265Z remote: golang.org/x/net/http2        
2020-08-28T13:54:32.6879455Z remote: google.golang.org/protobuf/runtime/protoimpl        
2020-08-28T13:54:32.6879635Z remote: github.com/golang/protobuf/proto        
2020-08-28T13:54:32.6879817Z remote: google.golang.org/grpc/credentials        
2020-08-28T13:54:32.6879999Z remote: google.golang.org/grpc/resolver        
2020-08-28T13:54:32.6880171Z remote: google.golang.org/grpc/balancer        
2020-08-28T13:54:32.6880833Z remote: google.golang.org/grpc/balancer/base        
2020-08-28T13:54:32.6881211Z remote: google.golang.org/grpc/balancer/roundrobin        
2020-08-28T13:54:32.6881413Z remote: google.golang.org/grpc/encoding/proto        
2020-08-28T13:54:32.6881622Z remote: google.golang.org/protobuf/types/known/anypb        
2020-08-28T13:54:32.6881824Z remote: github.com/golang/protobuf/ptypes/any        
2020-08-28T13:54:32.6882033Z remote: google.golang.org/protobuf/types/known/durationpb        
2020-08-28T13:54:32.6882241Z remote: github.com/golang/protobuf/ptypes/duration        
2020-08-28T13:54:32.6882454Z remote: google.golang.org/protobuf/types/known/timestamppb        
2020-08-28T13:54:32.6882657Z remote: google.golang.org/grpc/internal/grpcutil        
2020-08-28T13:54:32.6882870Z remote: google.golang.org/genproto/googleapis/rpc/status        
2020-08-28T13:54:32.6883082Z remote: github.com/golang/protobuf/ptypes/timestamp        
2020-08-28T13:54:32.6883270Z remote: google.golang.org/grpc/internal/channelz        
2020-08-28T13:54:32.6883469Z remote: github.com/golang/protobuf/ptypes        
2020-08-28T13:54:32.6883677Z remote: google.golang.org/grpc/binarylog/grpc_binarylog_v1        
2020-08-28T13:54:32.6883878Z remote: google.golang.org/grpc/internal/status        
2020-08-28T13:54:32.6884085Z remote: google.golang.org/grpc/balancer/grpclb/state        
2020-08-28T13:54:32.6884289Z remote: google.golang.org/grpc/internal/resolver/dns        
2020-08-28T13:54:32.6884477Z remote: google.golang.org/grpc/status        
2020-08-28T13:54:32.6884675Z remote: google.golang.org/grpc/internal/binarylog        
2020-08-28T13:54:32.6884888Z remote: google.golang.org/grpc/internal/resolver/passthrough        
2020-08-28T13:54:32.6885100Z remote: google.golang.org/grpc/internal/serviceconfig        
2020-08-28T13:54:32.6885299Z remote: google.golang.org/grpc/internal/syscall        
2020-08-28T13:54:32.6885494Z remote: google.golang.org/grpc/keepalive        
2020-08-28T13:54:32.6885678Z remote: google.golang.org/grpc/peer        
2020-08-28T13:54:32.6885862Z remote: google.golang.org/grpc/stats        
2020-08-28T13:54:32.6886044Z remote: google.golang.org/grpc/tap        
2020-08-28T13:54:32.6886229Z remote: google.golang.org/api/iterator        
2020-08-28T13:54:32.6886431Z remote: google.golang.org/grpc/internal/transport        
2020-08-28T13:54:32.6886629Z remote: golang.org/x/net/context/ctxhttp        
2020-08-28T13:54:32.6886803Z remote: golang.org/x/oauth2/internal        
2020-08-28T13:54:32.6886976Z remote: golang.org/x/oauth2        
2020-08-28T13:54:32.6887170Z remote: cloud.google.com/go/compute/metadata        
2020-08-28T13:54:32.6887356Z remote: golang.org/x/oauth2/jws        
2020-08-28T13:54:32.6887536Z remote: golang.org/x/oauth2/jwt        
2020-08-28T13:54:32.6887714Z remote: golang.org/x/oauth2/google        
2020-08-28T13:54:32.6887969Z remote: go.opencensus.io/resource        
2020-08-28T13:54:32.6888164Z remote: go.opencensus.io/metric/metricdata        
2020-08-28T13:54:32.6888343Z remote: go.opencensus.io/tag        
2020-08-28T13:54:32.6888521Z remote: google.golang.org/grpc        
2020-08-28T13:54:32.6888707Z remote: go.opencensus.io/stats/internal        
2020-08-28T13:54:32.6888888Z remote: go.opencensus.io/stats        
2020-08-28T13:54:32.6889133Z remote: go.opencensus.io/internal/tagencoding        
2020-08-28T13:54:32.6889336Z remote: go.opencensus.io/metric/metricproducer        
2020-08-28T13:54:32.6889529Z remote: go.opencensus.io/stats/view        
2020-08-28T13:54:32.6889703Z remote: github.com/golang/groupcache/lru        
2020-08-28T13:54:32.6889876Z remote: go.opencensus.io        
2020-08-28T13:54:32.6890056Z remote: go.opencensus.io/internal        
2020-08-28T13:54:32.6890245Z remote: go.opencensus.io/trace/internal        
2020-08-28T13:54:32.6890435Z remote: go.opencensus.io/trace/tracestate        
2020-08-28T13:54:32.6890619Z remote: go.opencensus.io/trace        
2020-08-28T13:54:32.6890808Z remote: go.opencensus.io/trace/propagation        
2020-08-28T13:54:32.6890997Z remote: go.opencensus.io/plugin/ocgrpc        
2020-08-28T13:54:32.6891705Z remote: github.com/google/go-cmp/cmp/internal/flags        
2020-08-28T13:54:32.6892087Z remote: github.com/google/go-cmp/cmp/internal/diff        
2020-08-28T13:54:32.6892444Z remote: github.com/googleapis/gax-go/v2        
2020-08-28T13:54:32.6892637Z remote: google.golang.org/api/internal        
2020-08-28T13:54:32.6893007Z remote: github.com/google/go-cmp/cmp/internal/function        
2020-08-28T13:54:32.6893376Z remote: github.com/google/go-cmp/cmp/internal/value        
2020-08-28T13:54:32.6893569Z remote: google.golang.org/api/option        
2020-08-28T13:54:32.6893904Z remote: github.com/google/go-cmp/cmp        
2020-08-28T13:54:32.6894115Z remote: google.golang.org/grpc/balancer/grpclb/grpc_lb_v1        
2020-08-28T13:54:32.6894315Z remote: google.golang.org/grpc/credentials/alts/internal        
2020-08-28T13:54:32.6894590Z remote: google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp        
2020-08-28T13:54:32.6894817Z remote: google.golang.org/grpc/credentials/alts/internal/authinfo        
2020-08-28T13:54:32.6895037Z remote: google.golang.org/grpc/credentials/alts/internal/conn        
2020-08-28T13:54:32.6895264Z remote: google.golang.org/grpc/credentials/alts/internal/handshaker        
2020-08-28T13:54:32.6895505Z remote: google.golang.org/grpc/credentials/alts/internal/handshaker/service        
2020-08-28T13:54:32.6895723Z remote: google.golang.org/grpc/credentials/alts        
2020-08-28T13:54:32.6895932Z remote: google.golang.org/grpc/credentials/oauth        
2020-08-28T13:54:32.6896134Z remote: google.golang.org/grpc/balancer/grpclb        
2020-08-28T13:54:32.6896339Z remote: google.golang.org/grpc/credentials/google        
2020-08-28T13:54:32.6896549Z remote: google.golang.org/protobuf/types/known/emptypb        
2020-08-28T13:54:32.6896759Z remote: github.com/golang/protobuf/ptypes/empty        
2020-08-28T13:54:32.6896968Z remote: google.golang.org/protobuf/internal/encoding/json        
2020-08-28T13:54:32.6897171Z remote: google.golang.org/api/transport/grpc        
2020-08-28T13:54:32.6897376Z remote: google.golang.org/protobuf/encoding/protojson        
2020-08-28T13:54:32.6897587Z remote: google.golang.org/protobuf/types/known/wrapperspb        
2020-08-28T13:54:32.6897798Z remote: github.com/golang/protobuf/ptypes/wrappers        
2020-08-28T13:54:32.6898007Z remote: google.golang.org/protobuf/types/descriptorpb        
2020-08-28T13:54:32.6898214Z remote: google.golang.org/protobuf/types/known/structpb        
2020-08-28T13:54:32.6898417Z remote: github.com/golang/protobuf/ptypes/struct        
2020-08-28T13:54:32.6898627Z remote: google.golang.org/genproto/googleapis/type/latlng        
2020-08-28T13:54:32.6898823Z remote: cloud.google.com/go/internal/btree        
2020-08-28T13:54:32.6899201Z remote: github.com/golang/protobuf/protoc-gen-go/descriptor        
2020-08-28T13:54:32.6899497Z remote: google.golang.org/genproto/googleapis/api/annotations        
2020-08-28T13:54:32.6899698Z remote: cloud.google.com/go/internal/fields        
2020-08-28T13:54:32.6899908Z remote: google.golang.org/genproto/googleapis/firestore/v1        
2020-08-28T13:54:32.6900127Z remote: google.golang.org/api/internal/third_party/uritemplates        
2020-08-28T13:54:32.6900376Z remote: google.golang.org/api/googleapi        
2020-08-28T13:54:32.6900581Z remote: google.golang.org/genproto/googleapis/rpc/code        
2020-08-28T13:54:32.6900783Z remote: cloud.google.com/go/internal/trace        
2020-08-28T13:54:32.6900979Z remote: cloud.google.com/go/internal/version        
2020-08-28T13:54:32.6901191Z remote: go.opencensus.io/plugin/ochttp/propagation/b3        
2020-08-28T13:54:32.6901385Z remote: go.opencensus.io/plugin/ochttp        
2020-08-28T13:54:32.6901587Z remote: google.golang.org/api/googleapi/transport        
2020-08-28T13:54:32.6901793Z remote: cloud.google.com/go/firestore/apiv1        
2020-08-28T13:54:32.6902102Z remote: google.golang.org/api/transport/cert        
2020-08-28T13:54:32.6902305Z remote: google.golang.org/api/transport/http/internal/propagation        
2020-08-28T13:54:32.6902682Z remote: google.golang.org/api/transport/http        
2020-08-28T13:54:32.6902882Z remote: google.golang.org/genproto/googleapis/type/expr        
2020-08-28T13:54:32.6903069Z remote: google.golang.org/api/transport        
2020-08-28T13:54:32.6903259Z remote: google.golang.org/genproto/googleapis/iam/v1        
2020-08-28T13:54:32.6903422Z remote: cloud.google.com/go/firestore        
2020-08-28T13:54:32.6903602Z remote: firebase.google.com/go/internal        
2020-08-28T13:54:32.6903779Z remote: firebase.google.com/go/auth        
2020-08-28T13:54:32.6903953Z remote: firebase.google.com/go/db        
2020-08-28T13:54:32.6904124Z remote: firebase.google.com/go/iid        
2020-08-28T13:54:32.6904301Z remote: firebase.google.com/go/messaging        
2020-08-28T13:54:32.6904518Z remote: cloud.google.com/go/iam        
2020-08-28T13:54:32.6904693Z remote: cloud.google.com/go/internal        
2020-08-28T13:54:32.6905050Z remote: cloud.google.com/go/internal/optional        
2020-08-28T13:54:32.6905253Z remote: google.golang.org/api/internal/gensupport        
2020-08-28T13:54:32.6905459Z remote: google.golang.org/api/option/internaloption        
2020-08-28T13:54:32.6905655Z remote: golang.org/x/net/context        
2020-08-28T13:54:32.6905848Z remote: google.golang.org/api/storage/v1        
2020-08-28T13:54:32.6906315Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/utils/json_utility        
2020-08-28T13:54:32.6906734Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/utils/rules        
2020-08-28T13:54:32.6907142Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/responses        
2020-08-28T13:54:32.6907557Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/middlewares        
2020-08-28T13:54:32.6907747Z remote: github.com/joho/godotenv        
2020-08-28T13:54:32.6908131Z remote: github.com/jsdaniell/devdata-tools-api-golang/config        
2020-08-28T13:54:32.6908331Z remote: cloud.google.com/go/storage        
2020-08-28T13:54:32.6908518Z remote: firebase.google.com/go/storage        
2020-08-28T13:54:32.6908682Z remote: firebase.google.com/go        
2020-08-28T13:54:32.6909059Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/db        
2020-08-28T13:54:32.6909503Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/repository/suite_repository        
2020-08-28T13:54:32.6909950Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/repository/user_repository        
2020-08-28T13:54:32.6910368Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/controllers        
2020-08-28T13:54:32.6910781Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/router/routes        
2020-08-28T13:54:32.6911183Z remote: github.com/jsdaniell/devdata-tools-api-golang/api/router        
2020-08-28T13:54:32.6911660Z remote: github.com/jsdaniell/devdata-tools-api-golang/api        
2020-08-28T13:54:32.6912036Z remote: github.com/jsdaniell/devdata-tools-api-golang        
2020-08-28T13:54:32.6912364Z remote: �[1;32m       �[0m        
2020-08-28T13:54:32.6912734Z remote: �[1;32m       Installed the following binaries:�[0m        
2020-08-28T13:54:32.6913117Z remote: �[1;32m       		./bin/devdata-tools-api-golang�[0m        
2020-08-28T13:54:32.6913550Z remote: -----> Discovering process types        
2020-08-28T13:54:32.6913904Z remote:        Procfile declares types -> web        
2020-08-28T13:54:32.6914063Z remote: 
2020-08-28T13:54:32.6914378Z remote: -----> Compressing...        
2020-08-28T13:54:32.6914549Z remote:        Done: 20.9M        
2020-08-28T13:54:32.6914862Z remote: -----> Launching...        
2020-08-28T13:54:32.6915042Z remote:        Released v25        
2020-08-28T13:54:32.6915446Z remote:        https://dev-data-tools-api-golang.herokuapp.com/ deployed to Heroku        
2020-08-28T13:54:32.6915671Z remote: 
2020-08-28T13:54:32.6915847Z remote: Verifying deploy... done.        
2020-08-28T13:54:32.6916186Z To https://git.heroku.com/dev-data-tools-api-golang.git
2020-08-28T13:54:32.6916678Z  + f178336...5c29d72 5c29d72eb2e3527ba7345ff73dc900bba76b4b6a -> master (forced update)

After this deploy, the application is broken, but in my local shellscript deploy is all fine

Problem in Enviromental Variables

I have a lot of enivormental variables that I need to push to heroku.
I have stored all these variables in an encrypted .env.gpg file which I am later decrypting in one of the steps and put it in the folder where the heroku action will take place.
I need to pass this decrypted .env file to heroku.
How can I do this?

name: Frontend Deploy

on:
  push:
    branches:
      - autodeploy

jobs:
  deploytoheroku:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Decrypt frontend.env
        run: ./.github/scripts/frontend_decrypt.sh
      - uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{secrets.NEW_HEROKU_API_KEY}}
          heroku_app_name: "myapp"
          heroku_email: "[email protected]"
          branch: autodeploy
          appdir: frontend
      - run: echo "Deployed"

Why do we need the email?

Why do we need the email? isn't api token enough? What is email being used for? I feel like its sensitive information to share in yml file.

Support for pushing branches?

Thanks for this action, it's been very useful.

Is there any way to push a different branch to heroku? I know when I'm pushing a branch to heroku from my local computer I use git push HEROKU_APP_NAME BRANCH:master. Would it be possible to support different branches via maybe a with variable?

Deploy changes of action

In my action pipeline I do some file transformation of a JSON file using variable substitution action, I can even cat the file and check that everything is ok, but when I send it to the heroku-deploy action the file remains the same as before (without the file transformation).

How can I push my current with the transformations made?

My .yaml:

name: Chr0m1ng Twitter Bot CD

on:
  push:
    branches: [master]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Variable Substitution
        uses: microsoft/variable-substitution@v1
        with:
          files: "src/configs/*.json"
        env:
          twitter.access_token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
          twitter.access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
          twitter.api_key: ${{ secrets.TWITTER_API_KEY }}
          twitter.api_secret_key: ${{ secrets.TWITTER_API_SECRET_KEY }}
          mongo.connection_string: ${{ secrets.MONGO_CONNECTION_STRING }}
          mongo.database: ${{ secrets.MONGO_DATABASE }}
          bot.follow_triggers: ${{ secrets.BOT_FOLLOW_TRIGGERS }}

      - name: Cat settings
        run: cat "src/configs/settings.example.json"
      
      - name: Deploy to Heroku
        uses: AkhileshNS/[email protected]
        with:
          # This will be used for authentication. You can find it in your heroku homepage account settings
          heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
          # Email that you use with heroku
          heroku_email: [email protected]
          # The appname to use for deploying/updating
          heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}

How to set region

Using the action will deploy a container to herokus default region (us). is it possible to pass --region eu to heroku create command?

Retrieving the logs takes ages

I have a build process which takes a very long time to build on Heroku (nearly 30 Minutes). After the build finished I saw that the Github Action was still running. I aborted the action at (42m 22s running time). The action was in midst of printing line 931. The complete log was 6663 lines long.

This could be somewhat related to #5?

Failing to deploy.

Hello.

My workflow file is the following:

name: Deploy

on: 
  workflow_dispatch

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected]
        with:
          branch: "master"
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
          heroku_email: ${{ secrets.HEROKU_EMAIL }}

The error I'm receiving in the logs is this:

image

Healthcheck without docker

I'm using the action for a node.js app that doesn't use docker. The action deploys just fine (despite the README saying you need to use Docker), but it appears that the health check doesn't work... any idea if there's a way to get around that? Here's a link to my project and a link to a build that passed when the healthcheck should have failed and the app should have been rolled back.

Is there a more efficient way to do this?

Is there a better way to do this so that it combines some of the steps? Below is an example of my setup but I have 10 servers, I commit often and my github minutes are getting used up fast! :)

Thanks!

name: Deploy Beta

on:
  push:
    branches:
      - beta

jobs:
  push0:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected]
        with:
          branch: "beta"
          heroku_api_key: "asdf"
          heroku_app_name: "asdf-beta1"
          heroku_email: "[email protected]"
  push1:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/[email protected]
        with:
          branch: "beta"
          heroku_api_key: "asdf"
          heroku_app_name: "asdf-beta2"
          heroku_email: "[email protected]"

Procfile release command is ignored

Hello. Thanks for this awesome action. I was facing issues commiting directly to other branch, finally this is solution I needed.

So, after reading about how to run migrations after deploy I updated my Procfile, push the changes, run the action again and expect to populate my database, but did not happened.

The release command didn't run after deploy.

remote: -----> Launching...        
remote:  !     Release command declared: this new release will not be available until the command succeeds.        
remote:        Released v15        
remote:        https://***.herokuapp.com/ deployed to Heroku        
remote: 
remote: Verifying deploy... done.        
remote: Running release command...
remote: 
remote: **************************************        
remote: *     Application In Production!     *        
remote: **************************************        
remote: 
remote:  Do you really wish to run this command? (yes/no) [no]:        
remote:  > Command Canceled!        
remote: Waiting for release.... failed.        
To https://git.heroku.com/***.git
 * [new branch]      HEAD -> master

This is my Procfile. Does not seem to be wrong.

release: php artisan migrate
web: vendor/bin/heroku-php-nginx

I could write another step, log in to heroku and run the command but it is my least preferred solution

Deploying to ***

This may be an issue on how I'm doing things, but I'm not able to deploy to my project and the log says I'm trying to push to *** instead.

Here's the full output:

Run AkhileshNS/heroku-deploy@master
Created and wrote to ~./netrc
Successfully logged into heroku
heroku: Press any key to open up the browser to login or q to exit:  ›   Warning: heroku update available from 7.39.1 to 7.39.2.
Added git remote heroku
remote: 
remote: !	Push rejected, cannot delete master branch        
remote: 
To https://git.heroku.com/***.git
 ! [remote rejected] master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'

            Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch. 
            (If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml. 
            Specifically, the error was: Error: Command failed: git push heroku :refs/heads/master 
remote: 
remote: !	Push rejected, cannot delete master branch        
remote: 
To https://git.heroku.com/***.git
 ! [remote rejected] master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'

Here's my yml file:

# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2

    # Install dependencies
    - name: Install dependencies
      run: yarn install

    # Tests project
    - name: Test project
      run: yarn test

    # Builds project
    - name: Build project
      run: yarn build

    # Deploys to Heroku
    - name: Deploy to Heroku
      uses: AkhileshNS/heroku-deploy@master
      with:
        # This will be used for authentication. You can find it in your heroku homepage account settings
        heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
        # Email that you use with heroku
        heroku_email: ${{ secrets.HEROKU_EMAIL }}
        # The appname to use for deploying/updating
        heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
        # An optional buildpack to use when creating the heroku application
        buildpack: # optional
        # The branch that you would like to deploy to Heroku
        branch: # optional, default is HEAD
        # Set this to true if you don't want to use --force when switching branches
        dontuseforce: # optional
        # Will deploy using Dockerfile in project root.
        usedocker: # optional
        # Set if your app is located in a subdirectory.
        appdir: # optional, default is   

I added the secrets to my config a couple times already to make sure I wrote the correct values, seems like at least API_KEY is working correctly because the action is able to login.

I don't know what else to try, I tried adding the app name to the yml or adding it as a secret to no avail.
I'm learning Github Actions and I'm frustrated because I can't find a way out of this fairly easy problem.

Do you have an idea on how could I fix this?

all env file variables not passing

I am trying to put my env file (decrypted during workflow action) but this action is only taking the first variable.

Workflow is not failing but the application crashes due to missing env variables.

My workflow file is like this:

name: Backend Deploy

on:
  push:
    branches:
      - master
    paths:
      - 'backend/**'

jobs:
  backendDeploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - shell: bash
        env:
          DECRYPTER_PASSPHRASE: ${{secrets.DECRYPTER_PASSPHRASE}}
        run: >
          ./.github/scripts/backend_decrypt.sh
      - run: |
          cat backend/.env
          pwd
          ls -a
          ls backend/
      - uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "my-app"
          heroku_email: "[email protected]"
          branch: master
          appdir: backend
          env_file: ".env"
      - run: |
          ls -a
          echo "Deployed"

The enviromental variables are correctly decrypted and saved in the .env file

This is step cat backend/.env from the above workflow

env variables shown

But, only the first variable is passed

only 1 variable is passed

Can you help fix this?

Need more build detail

I set usedocker: true in my action. But it runs slow when build with docker without stdout.
Is there anyway to show more build details when use with docker?

Missing refs/heads/master on git push with appdir (Heroku + Git error)

Summary

When performing an app's first push to Heroku, the action will fail due to Heroku not having a master ref to push to. I believe we probably need to explicitly push to refs/heads/master since it doesn't exist yet on the Heroku side until that first push.

Once you've made (any) initial first push to the repository, the action works as expected.

Update Looks to be https://github.com/AkhileshNS/heroku-deploy/blob/master/index.js#L25 which just guesses master which is incorrect for an initial push.

Can Pull Request ✅ I'm happy to put together a PR for this issue

Steps to Reproduce

  1. Create an app in heroku, but don't push anything to it yet
  2. Set up your heroku step using the yaml
- name: Deploying to Heroku
  uses: akhileshns/[email protected]
  with:
    heroku_api_key: ${{secrets.HEROKU_API_KEY}}
    heroku_app_name: APP_NAME # change to your app
    heroku_email: ${{secrets.HEROKU_EMAIL}}
    appdir: services/SUBFOLDER # subfolder used here
  1. Run the action

Expected Result

  • First push to Heroku succeeds, detects buildpack, procfile, etc

Actual Result

Error: Command failed: git push --force heroku `git subtree split --prefix=services/SUBFOLDER HEAD`:master
1/1384 (0) [0]
2/1384 (1) [0]
3/1384 (2) [0]
4/1384 (3) [0]
... # lines skipped
1383/1384 (1382) [120]
1384/1384 (1383) [120]
error: The destination you provided is not a full refname (i.e.,
starting with "refs/"). We tried to guess what you meant by:

- Looking for a ref that matches 'master' on the remote side.
- Checking if the <src> being pushed ('31fd----------')
  is a ref in "refs/{heads,tags}/". If so we add a corresponding
  refs/{heads,tags}/ prefix on the remote side.

Neither worked, so we gave up. You must fully qualify the ref.
hint: The <src> part of the refspec is a commit object.
hint: Did you mean to create a new branch by pushing to
hint: '31fd----------:refs/heads/master'?
error: failed to push some refs to 'https://git.heroku.com/APP_NAME.git'

Additional Context

I was able to verify that the action works after manually making an initial "first push" to set a buildpack etc. It might be easier to tell people not to create the app on Heroku's side if they want a successful first push.

In the above example, I've removed sensitive information from GH Action log output.

Edits:

  • For clarity, cleaned up the action yaml to remove the app name I was pushing to

Error: fatal: not a git repository (or any of the parent directories)

I have a fresh .yml that looks like this:

name: Node.js CI

on:
  push:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Deploy to Heroku
      uses: AkhileshNS/[email protected]
      with:
        # This will be used for authentication. You can find it in your heroku homepage account settings
        heroku_api_key: ${{ secrets.api_key }}
        # Email that you use with heroku
        heroku_email: ${{ secrets.email }}
        # The appname to use for deploying/updating
        heroku_app_name: ${{ secrets.name }}
        branch: "master" 

But all my builds fails. It says:

##[error]Error: Command failed: git rev-parse --is-shallow-repository
fatal: not a git repository (or any of the parent directories): .git

Any ideas that what's happening? It's my first time with GitHub actions. Thanks in advance!

Pushing changes from a different branch to Heroku

Hi, following the Github action implementation I have this in my yml
- name: Login to Heroku and deploy
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: "master"

Am trying to push from a different branch to master on Heroku, got this error at first: error: src refspec master does not match any then later got this: fatal: empty ident name (for runner@fv-az20.kpwltci0mcyunckd222hihihaa.gx.internal.cloudapp.net) not allowed

Is there any way to run migrations?

I'm using to deploy Rails applications, to me it is a common practice to run the migrations after the deploy is done. To do it I go to my console and run:

heroku run 'rails db:migrate' -a APPLICATION_NAME

Is there a way to do it with this action?

How to deploy an artifacts directory?

I have a repository which has both the client and server directory. On push to master, I have a Github Action that compiles the client code and pastes its artifacts in the server/dist directory.

When I try to deploy the server directory by setting the appdir value to server, it does deploy the server but the dist folder inside it is missing. How do I make sure that directories created in the github workflow are preserved?

.npmignore

Does this action respect .npmignore in terms of what's deployed to Heroku? If it does, is there anything special we need to do to configure it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.