-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.33 KB
/
deployment.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
36
37
38
39
name: deploying to test instance
on:
push:
branches: [master]
jobs:
deploy:
name: Performing remote connection
runs-on: ubuntu-latest
steps:
- name: Remote Connection Setup
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.CICD2_HOST }}
username: ${{ secrets.CICD2_USERNAME }}
key: ${{ secrets.CICD2_SECRET }}
port: ${{ secrets.PORT }}
script: |
# Set up deployment directory
deploy_dir="/apps/github-workflows/mhealth-apps/kenyaemr_visualization_reciever"
sudo rm -rf "$deploy_dir"
sudo mkdir "$deploy_dir"
sudo chown -R cicd2:cicd2 "$deploy_dir"
# Clone repository
git config --global --add safe.directory "$deploy_dir"
git clone -b master https://github.com/palladiumkenya/kenyaemr_visualization_receiver.git "$deploy_dir"
# Copy configuration files
cp /apps/configs/kvisual/.env "$deploy_dir/"
# Build and run Docker container
docker stop kvisual
docker rm -f kvisual
docker build -t kvisual:latest "$deploy_dir"
docker run -p 7008:5000 --name kvisual -d --restart always --security-opt=no-new-privileges --log-opt max-size=10m \
--log-opt max-file=3 kvisual:latest