forked from mHealthKenya/psurvey
-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (33 loc) · 1.36 KB
/
cicd_process.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: deploy to test instance
on:
push:
branches: [ dev ]
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: executing remote connection
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.CICD_SECRET }}
port: ${{ secrets.PORT }}
script: |
cd /apps/github-workflows/mhealth-apps/
sudo rm -rf psurvey
sudo mkdir psurvey
sudo chown -R cicd2:cicd2 psurvey
git config --global --add safe.directory /apps/github-workflows/mhealth-apps/psurvey
cd psurvey/
git clone -b dev https://github.com/palladiumkenya/psurvey.git .
git status
cp /apps/dockerApps/psurvey/python.dockerfile /apps/github-workflows/mhealth-apps/psurvey
cp /apps/dockerApps/psurvey/nginx.dockerfile /apps/github-workflows/mhealth-apps/psurvey
cp /apps/dockerApps/psurvey/secrets.json /apps/github-workflows/mhealth-apps/psurvey
cp /apps/dockerApps/psurvey/pSurvey/settings.py /apps/github-workflows/mhealth-apps/psurvey/pSurvey
# cp -r /apps/dockerApps/psurvey/docker/ /apps/github-workflows/mhealth-apps/psurvey.
docker-compose stop pythonapp
docker-compose rm -f pythonapp
docker-compose up -d pythonapp