Skip to content

Deploy to Heroku

Deploy to Heroku #46

Workflow file for this run

name: Deploy to Heroku
on:
workflow_call:
inputs:
branch:
description: "Branch to deploy"
required: true
type: string
workflow_dispatch:
inputs:
branch:
description: "Branch to deploy"
required: true
type: string
default: master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: maven
- name: Deploy
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: mvn -B clean heroku:deploy
scale:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Sleep for 30 seconds
uses: whatnick/wait-action@master
with:
time: '30s'
- name: Scale worker
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_APP_NAME: ${{ secrets.HEROKU_APP_NAME }}
run: heroku ps:scale worker=1 -a $HEROKU_APP_NAME