Skip to content

Commit

Permalink
chore: update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
extern-maksim-kuzmin1 committed Feb 25, 2024
1 parent ff78eda commit ed135fa
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CD

on:
workflow_run:
workflows: [ "CI" ]
branches: [ master ]
types:
- completed

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/deploy
with:
branch: master
17 changes: 9 additions & 8 deletions .github/workflows/deploy.yml → .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
name: Deploy to Heroku

on:
workflow_dispatch:
workflow_run:
workflows: [ "CI" ]
branches: [ master ]
types:
- completed
workflow_call:
inputs:
branch:
description: "Branch to deploy"
required: true
type: string

jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
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:
Expand All @@ -23,7 +24,7 @@ jobs:
- name: Deploy
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: mvn -B clean heroku:deploy -DskipTests
run: mvn -B clean heroku:deploy
scale:
needs: deploy
runs-on: ubuntu-latest
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/manual_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Manual deploy to Heroku

on:
workflow_dispatch:
inputs:
branch:
description: "Branch to deploy"
required: true
type: string

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- uses: ./.github/workflows/deploy
with:
branch: ${{ github.event.inputs.branch }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#### ...with Telegram Admin panel

![CI](https://github.com/whiskels/NotifierBot/actions/workflows/ci.yml/badge.svg)
![Deploy to Heroku](https://github.com/whiskels/NotifierBot/actions/workflows/deploy.yml/badge.svg)
![Deploy to Heroku](https://github.com/whiskels/NotifierBot/actions/workflows/CD.yml/badge.svg)
[![codecov](https://codecov.io/gh/whiskels/NotifierBot/graph/badge.svg?token=F51GAFZ63Q)](https://codecov.io/gh/whiskels/NotifierBot)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/307f26a176cd4488b19db004f6705254)](https://www.codacy.com/gh/whiskels/TelegramNotifierBot/dashboard?utm_source=github.com&utm_medium=referral&utm_content=whiskels/TelegramNotifierBot&utm_campaign=Badge_Grade)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fwhiskels%2FTelegramNotifierBot&count_bg=%2379C83D&title_bg=%23555555&icon=telegram.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
Expand Down

0 comments on commit ed135fa

Please sign in to comment.