-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (45 loc) · 1.61 KB
/
ci.yml
File metadata and controls
45 lines (45 loc) · 1.61 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
deployment:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Connect by ssh and run new build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
passphrase: ${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/deploy/applications/letscode
git fetch --all
git reset --hard origin/master
docker-compose up -d
- name: Notify telegram group about a successful deployment
if: ${{ success() }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_GROUP_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
format: HTML
message: |
<b>LetsCode.io:</b> <a href="https://github.com/letscode-io/letscode.io/commit/${{ github.sha }}">Deployment #${{github.run_id}}</a>
✅ Deployment has been finished successfully
- name: Notify telegram group about a failed deployment
if: ${{ failure() }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_GROUP_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
format: HTML
message: |
<b>LetsCode.io:</b> <a href="https://github.com/letscode-io/letscode.io/commit/${{ github.sha }}">Deployment #${{github.run_id}}</a>
💩 Deployment has been failed