-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
518f6b7
commit 04f440d
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
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 |