Skip to content

Merge pull request #80 from jecihjoy/maven_deploy_cicd #20

Merge pull request #80 from jecihjoy/maven_deploy_cicd

Merge pull request #80 from jecihjoy/maven_deploy_cicd #20

Workflow file for this run

name: deploy to prod 8600
on:
push:
branches: [ master ]
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 }}
command_timeout: 200m
script: |
cd /apps/github-workflows/kenyaemr-modules
sudo rm -rf openmrs-module-afyastat
sudo mkdir openmrs-module-afyastat
sudo chown cicd2:cicd2 openmrs-module-afyastat
git config --global --add safe.directory /apps/github-workflows/kenyaemr-modules/openmrs-module-afyastat
cd /apps/github-workflows/kenyaemr-modules/openmrs-module-afyastat
git clone https://github.com/palladiumkenya/openmrs-module-afyastat.git .
sudo chown cicd2:cicd2 openmrs-module-afyastat/openmrs-module-afyastat
git status
mvn clean install -DskipTests
sudo rm -rf /var/lib/OpenMRS/modules/afyastat-*.omod
sudo cp /apps/github-workflows/kenyaemr-modules/openmrs-module-afyastat/omod/target/afyastat-*.omod /var/lib/OpenMRS/modules/
sudo chown -R tomcat:tomcat /var/lib/OpenMRS/modules/
sudo chmod +r /var/lib/OpenMRS/modules/*.omod
sudo chmod 755 /var/lib/OpenMRS/modules/*.omod
sudo systemctl stop tomcat
sudo systemctl start tomcat