Skip to content

Commit

Permalink
Add deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nyatindopatrick committed Sep 8, 2024
1 parent 518f6b7 commit 04f440d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy to VM

on:
push:
branches:
- main
workflow_dispatch:
env:
SSH_PORT: 22

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Set up SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Remote ssh to server and update docker-compose
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ env.SSH_PORT }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script_stop: true
script: |
cd /opt/bdsec-repos/Bdsec-metadata
sudo git pull origin main
cd /opt/bdsec-repos/bahmni-docker/bahmni-standard
sudo docker-compose down openmrs -v
sudo docker-compose up -d --no-deps --build openmrs

0 comments on commit 04f440d

Please sign in to comment.