Deploy to Heroku #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |