AkhileshNS / heroku-deploy

A simple github action that dynamically deploys an app to heroku
MIT License
974 stars 254 forks source link

How do I deploy to a different heroku app? #109

Open mattfranciswork0 opened 2 years ago

mattfranciswork0 commented 2 years ago

Here is how I am pushing it to my heroku app when I make changes on main. How do I deploy it to a different Heroku app (named gh-actions-uat) when I make changes on the development branch?

name: Deploy

on:
    push:
        branches:
            - main

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2  
            - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action
              with:
                  heroku_api_key: ${{secrets.HEROKU_API_KEY}}
                  heroku_app_name: "gh-actions-prod" #Must be unique in Heroku
                  heroku_email: "a888@gmail.com"
ferny1313 commented 2 years ago

This does note seems to be an issue, 🤔 but here's the way I will do what you are asking. I will copy paste the file you are providing & just change the target branch. Meaning that you will have to deployment files on your repo, one for mainand the other for develop Following the example you are using:

name: Deploy To Develop Branch

on:
    push:
        branches:
            - develop

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2  
            - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action
              with:
                  heroku_api_key: ${{secrets.HEROKU_API_KEY}}
                  heroku_app_name: "gh-actions-uat" #Must be unique in Heroku
                  heroku_email: "a888@gmail.com"

Hopping this help anyone 👍