Update docker-image.yml #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deployment CICD | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: executing remote connection | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.CICD_HOST }} | |
username: ${{ secrets.CICD_USERNAME }} | |
key: ${{ secrets.CICD_SECRET }} | |
port: ${{ secrets.PORT }} | |
script: | | |
cd /apps/githubworkflows/ | |
sudo chown -R cicd:cicd SyncAllEMRs | |
git config --global --add safe.directory /apps/githubworkflows/SyncAllEMRs | |
cd SyncAllEMRs && git pull https://github.com/palladiumkenya/SyncAllEMRs.git | |
sudo cp /apps/dockerApps/SyncAllEMRs/Dockerfile . | |
sudo cp /apps/dockerApps/SyncAllEMRs/docker-compose.yml . | |
sudo cp /apps/dockerApps/SyncAllEMRs/.env . | |
sudo docker-compose stop dwh_his_sync_allemrs && docker-compose rm -f dwh_his_sync_allemrs | |
sudo docker-compose up -d | |
echo "done" | |