-
Notifications
You must be signed in to change notification settings - Fork 13
33 lines (28 loc) · 1.05 KB
/
heroku-remove-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Heroku Teardown Pull Request
on:
pull_request:
types: [closed]
jobs:
heroku-pull-request:
runs-on: ubuntu-latest
env:
HEROKU_APP_NAME: gyr-review-app-${{ github.event.number }}
steps:
- name: Login to Heroku
uses: akhileshns/heroku-deploy@v3.12.13
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_email: jheath@codeforamerica.org
heroku_app_name: ${{ env.HEROKU_APP_NAME }}
justlogin: true
- name: Install Heroku CLI
run: |
curl https://cli-assets.heroku.com/install.sh | sh
- name: Predestroy the app associated with the closed PR
run: heroku run rails heroku:review_app_predestroy --app=${{ env.HEROKU_APP_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Actually destroy the Heroku app associated with the closed PR
run: heroku apps:destroy --app=${{ env.HEROKU_APP_NAME }} --confirm=${{ env.HEROKU_APP_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}