Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split frontend/backend releases #1725

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/deploy-backend-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Production Deploy (Backend)

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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: release

- name: Set VERSION
run: echo "VERSION=$(./scripts/get_version.sh)" >> $GITHUB_ENV

- name: Write commit SHA to file
run: echo $GITHUB_SHA > frontends/main/public/hash.txt

- name: Heroku login
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login

- name: Release Backend on Heroku
uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: mitopen-production
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'
48 changes: 48 additions & 0 deletions .github/workflows/deploy-backend-release-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release Candidate Deploy (Backend)

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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: release-candidate

- name: Set VERSION
run: echo "VERSION=$(./scripts/get_version.sh)" >> $GITHUB_ENV

- name: Write commit SHA to file
run: echo $GITHUB_SHA > frontends/main/public/hash.txt

- name: Heroku login
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login

- name: Release Backend on Heroku
uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: mitopen-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'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Production Deploy
name: Production Deploy (Frontend)

on:
workflow_run:
Expand All @@ -25,19 +25,6 @@ jobs:
- name: Write commit SHA to file
run: echo $GITHUB_SHA > frontends/main/public/hash.txt

- name: Heroku login
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login

- name: Release Backend on Heroku
uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: mitopen-production
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: release

- name: Build and push the Docker image
env:
HEROKU_APP_NAME: mitopen-production-nextjs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Candidate Deploy
name: Release Candidate Deploy (Frontend)

on:
workflow_run:
Expand All @@ -25,19 +25,6 @@ jobs:
- name: Write commit SHA to file
run: echo $GITHUB_SHA > frontends/main/public/hash.txt

- name: Heroku login
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login

- name: Release Backend on Heroku
uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: mitopen-rc
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: release-candidate

- name: Build and push the Docker image
env:
HEROKU_APP_NAME: mitopen-rc-nextjs
Expand Down
Loading