-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (30 loc) · 1.22 KB
/
monitoring.yml
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
name: -Service- Monitoring (Grafana Loki Promtail)
on: workflow_dispatch
jobs:
build-and-deploy-auth-service:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.LINUX_PRIVATE_KEY_BASE64 }}" | base64 -d > ~/.ssh/id_rsa
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa ${{ secrets.LINUX_HOST }} >> ~/.ssh/known_hosts
- name: Remove directory on server
run: |
ssh -i ~/.ssh/id_rsa ${{ secrets.LINUX_USERNAME }}@${{ secrets.LINUX_HOST }} "rm -rf ~/dhammanava-search/monitoring"
- name: Copy monitoring directory to server
run: |
scp -r -i ~/.ssh/id_rsa ./monitoring ${{ secrets.LINUX_USERNAME }}@${{ secrets.LINUX_HOST }}:~/dhammanava-search
- name: Deploy to Ubuntu server
uses: appleboy/ssh-action@master
with:
host: ${{secrets.LINUX_HOST}}
username: ${{secrets.LINUX_USERNAME}}
key: ${{ secrets.LINUX_PRIVATE_KEY }}
script: |
cd dhammanava-search
docker compose -f docker-compose.prod.yml up -d loki promtail grafana prometheus