Skip to content

Deploy to Bahmni Standard Docker Env #21

Deploy to Bahmni Standard Docker Env

Deploy to Bahmni Standard Docker Env #21

name: Deploy to Bahmni Standard Docker Env
on:
workflow_run:
types: [ completed ]
workflows:
- Build and Publish OpenELIS Demo DB
- Build and Publish OpenELIS Fresh DB
- Build and Publish OpenELIS
jobs:
trigger:
name: Trigger auto deploy
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
ORG_NAME: Bahmni
REPOSITORY_NAME: bahmni-docker
EVENT_TYPE: openelis-publish-event
steps:
- name: Create repository_dispatch
run: |
trigger_result=$(curl -s -o trigger_response.txt -w "%{http_code}" -X POST -H "Accept: application/vnd.github.v3+json" -H 'authorization: Bearer ${{ secrets.BAHMNI_PAT }}' https://api.github.com/repos/${ORG_NAME}/${REPOSITORY_NAME}/dispatches -d '{"event_type":"'"${EVENT_TYPE}"'"}')
if [ $trigger_result == 204 ];then
echo "Trigger to $ORG_NAME/$REPOSITORY_NAME Success"
else
echo "Trigger to $ORG_NAME/$REPOSITORY_NAME Failed"
cat trigger_response.txt
exit 1
fi