Skip to content

03. Set workflows CD heroku

seakBz edited this page Jun 20, 2021 · 1 revision

Editing Set workflows CD heroku

This tutorial shows how to set up and deploy a wedding invitation web app on Heroku. Wedding-Invitation is a NodeJs application.

Steps covered in this tutorial:

  1. Create workflows
  2. Create Secret key
  3. Add ENV for Heroku host

Create workflows on the github repo

Create workflows

  • Select branch
 branches: [product]  
  • Edit workflow file
name: Deploy Heroku

on:
  push:
    branches: [product]  
jobs:

  deploy:
      name: Deploy
      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: ${{ secrets.HEROKU_APP_NAME }}
          heroku_email: "[email protected]"

Create Secret key

Create Secret key

HEROKU_API_KEY: <get in cmd: https://devcenter.heroku.com/articles/authentication#retrieving-the-api-token>
HEROKU_APP_NAME: <app name in heroku>

HEROKU_API_KEY - retrieving the API token

Add env

  • Go to app on Heroku -> select you app -> settings
  • Add Key

Add env

Good luck 🍀 !