Skip to content

Commit

Permalink
Added heroku deployment workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysyngsun committed May 12, 2022
1 parent cbe6e8d commit ec814a0
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Production Deploy

on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [release]
workflow_dispatch: # manual trigger

jobs:
# runs if CI workflow was successful OR if this was manually triggered
on-success:
runs-on: ubuntu-latest
if: >
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v2
with:
ref: release
- uses: akhileshns/heroku-deploy@79ef2ae4ff9b897010907016b268fd0f88561820
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: "bootcamp-ecommerce"
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: release
# runs ONLY on a failure of the CI workflow
on-failure:
runs-on: ubuntu-latest
if: >
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'failure'
steps:
- run: echo 'The triggering workflow failed'
34 changes: 34 additions & 0 deletions .github/workflows/release-candiate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release Candidate Deploy

on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [release-candidate]
workflow_dispatch: # manual trigger

jobs:
# runs if CI workflow was successful OR if this was manually triggered
on-success:
runs-on: ubuntu-latest
if: >
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v2
with:
ref: release-candidate
- uses: akhileshns/heroku-deploy@79ef2ae4ff9b897010907016b268fd0f88561820
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: "bootcamp-ecommerce-rc"
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: release-candidate
# runs ONLY on a failure of the CI workflow
on-failure:
runs-on: ubuntu-latest
if: >
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'failure'
steps:
- run: echo 'The triggering workflow failed'

0 comments on commit ec814a0

Please sign in to comment.