Skip to content

-Service- Monitoring (Grafana Loki Promtail Prometheus) #3

-Service- Monitoring (Grafana Loki Promtail Prometheus)

-Service- Monitoring (Grafana Loki Promtail Prometheus) #3

Workflow file for this run

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