Code Monkey home page Code Monkey logo

Comments (5)

AkhileshNS avatar AkhileshNS commented on May 20, 2024

You're right in that the Heroku Cli should be installed by default. Could you provide your buildlog and workflow file if possible?

from heroku-deploy.

patrickmead avatar patrickmead commented on May 20, 2024

Thank you very much, @AkhileshNS

`# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node

For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Dendra API CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
container: node:10.18-jessie
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
strategy:
matrix:
node-version: [14.x]

steps:
# - name: setup ssh
#   uses: webfactory/[email protected]
#   with:
#     ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up node.js v${{ matrix.node-version }}
  uses: actions/setup-node@v2
  with:
    node-version: ${{ matrix.node-version }}


- name: Clone Dendra Repo
  uses: actions/checkout@v2

- name: Setup NPM Private Github Packages
  run: |
    echo "@general-galactic:registry=https://npm.pkg.github.com" > .npmrc
    echo "//npm.pkg.github.com/:_authToken=${{secrets.GH_NPM_REGISTRY_TOKEN}}" >> .npmrc
    echo "always-auth=true" >> .npmrc

# - name: Print working directory
#   run: pwd

# - name: Print npm info
#   run: cat .npmrc

# - name: Print env
#   run: env



# - name: git clone a private repo
#   run: git clone --depth=1 -q -b master git://github.com/general-galactic/hapi-swagger.git ./crap && ls ./crap

# - name: npm install from a private github repo
#   run: npm i git://github.com/general-galactic/hapi-swagger && ls node_modules/hapi-swagger

# - name: npm install private github package
#   run: npm i @general-galactic/dendra-jwt && ls node_modules/@general-galactic/dendra-jwt

# - name: verify ssh key works
#   run: ssh -T [email protected]

# - name: Authenticate to Github Package Registry for private NPM modules
#   run: echo "//npm.pkg.github.com/:_authToken=${{secrets.GH_NPM_REGISTRY_TOKEN}}" >> .npmrc

- name: Install Dendra API Dependencies
  # Skiping post-install scripts here, as a malicious script could steal NODE_AUTH_TOKEN.
  # running bcrypt separately since it requires a post-install script
  run: npm ci

- name: Install hapi-swagger
  run: npm i git://github.com/general-galactic/hapi-swagger

- name: Lint Dendra API
  run: npm run lint:ci

- name: Run Tests
  env:
    DATABASE_URL: postgres://postgres:postgres@postgres:5432/dendra-test # the github postgres container chose all the defaults.
  run: npm test

- name: Deploy to Heroku
  uses: akhileshns/[email protected] 
  with:
      heroku_api_key: ${{secrets.HEROKU_API_KEY}}
      heroku_app_name: "dendra-api-stage" 
      heroku_email: "[email protected]"  
      justlogin: true
      remote_branch: main

- name: Notify Slack Failure
  if: failure()
  env:
    SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
  uses: voxmedia/github-action-slack-notify-build@v1
  with:
    channel: build-updates
    status: Dendra API Build Failed
    color: danger

- name: Notify Slack Success
  if: success()
  env:
    SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
  uses: voxmedia/github-action-slack-notify-build@v1
  with:
    channel: build-updates
    status: SUCCESS
    color: good

`

from heroku-deploy.

patrickmead avatar patrickmead commented on May 20, 2024

This is the portion of the build output for the deploy. I can post the rest of the output if this isn't sufficient.

I'm new to GitHub Actions but I have experience with Jenkins and Travis. Perhaps I'm missing something obvious.

Thanks again.

`##[debug]Evaluating condition for step: 'Deploy to Heroku'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Deploy to Heroku
##[debug]Loading inputs
##[debug]Evaluating: secrets.HEROKU_API_KEY
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'HEROKU_API_KEY'
##[debug]=> ''
##[debug]Result: '
'
##[debug]Loading env
Run akhileshns/[email protected]
with:
heroku_api_key: ***
heroku_app_name: dendra-api-stage
heroku_email: [email protected]
justlogin: true
remote_branch: main
branch: HEAD
dontuseforce: false
dontautocreate: false
usedocker: false
docker_heroku_process_type: web
delay: 0
rollbackonhealthcheckfailed: false
/usr/bin/docker exec d224d0edefcad3d011012710e18d99607e0374004dc00290bba841bf1aa1937a sh -c "cat /etc/*release | grep ^ID"
##[debug]ID=debian
##[debug]Running JavaScript Action with default external tool: node12
Created and wrote to ~/.netrc
/bin/sh: 1: heroku: not found
Error: Error: Command failed: heroku login
/bin/sh: 1: heroku: not found

##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Deploy to Heroku`

from heroku-deploy.

AkhileshNS avatar AkhileshNS commented on May 20, 2024

I think it might have something to do with you using container: node:10.18-jessie. It's possible that it's because the node: 10.18-jessie image doesn't have heroku installed by default unlike the default ones used in github actions. Can you try adding the following step before the heroku deploy step and see if this works:

- name: Install Heroku Cli
  run: curl https://cli-assets.heroku.com/install-ubuntu.sh | sh

from heroku-deploy.

patrickmead avatar patrickmead commented on May 20, 2024

@AkhileshNS
That was it!

My last build ran with login only so I'm actually trying to deploy now.

I truly appreciate your quick reply and the assistance. Thanks again.

from heroku-deploy.

Related Issues (20)

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.