Skip to content

Deploy on Webhook

Deploy on Webhook #8

name: Deploy on Webhook
on:
workflow_run:
workflows:
- "Python Lint"
- "Run tests"
types:
- completed
jobs:
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check lint and test results
run: |
if [ "${{ github.event.workflow_run.conclusion }}" != "success" ]; then
echo "Lint or Test workflow did not succeed. Exiting."
exit 1
fi
- name: Trigger Deployment Webhook
env:
WEBHOOK_DOMAIN: ${{ secrets.WEBHOOK_DOMAIN }}
WEBHOOK_TOKEN: ${{ secrets.WEBHOOK_TOKEN }}
run: |
curl -X POST https://${{ secrets.WEBHOOK_DOMAIN }}/webhook/deploy -H "Authorization: Bearer ${{ secrets.WEBHOOK_TOKEN }}"