Skip to content

Commit

Permalink
Merge pull request #28 from Bahmni/BAH-3385
Browse files Browse the repository at this point in the history
BAH-3385 | Trigger deployments to odoo 16 environment
  • Loading branch information
mohan-13 authored Dec 6, 2023
2 parents 30c8986 + 9edb06b commit 80300b4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/trigger_odoo16_env_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to Odoo Upgrade Env

on:
workflow_run:
types: [ completed ]
workflows:
- Build and Publish Odoo 16

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: odoo16-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

0 comments on commit 80300b4

Please sign in to comment.