Deploy on Webhook #8
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
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 }}" |