From ec814a0827c472fbfd4a9eed4f94b2ab915e340f Mon Sep 17 00:00:00 2001 From: Nathan Levesque Date: Thu, 12 May 2022 13:26:25 -0400 Subject: [PATCH] Added heroku deployment workflows --- .github/workflows/production.yml | 34 ++++++++++++++++++++++++++ .github/workflows/release-candiate.yml | 34 ++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/production.yml create mode 100644 .github/workflows/release-candiate.yml diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml new file mode 100644 index 000000000..283753a4b --- /dev/null +++ b/.github/workflows/production.yml @@ -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' diff --git a/.github/workflows/release-candiate.yml b/.github/workflows/release-candiate.yml new file mode 100644 index 000000000..108880b45 --- /dev/null +++ b/.github/workflows/release-candiate.yml @@ -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' \ No newline at end of file