File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy
2+
3+ on :
4+ workflow_run :
5+ workflows : ["Python application"]
6+ types : [completed]
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+ if : >-
12+ github.event.workflow_run.conclusion == 'success'
13+ && startsWith(github.event.workflow_run.head_branch, '20')
14+ steps :
15+ - name : Trigger deploy webhook
16+ env :
17+ WEBHOOK_SECRET : ${{ secrets.DEPLOY_WEBHOOK_SECRET }}
18+ run : |
19+ REF="refs/tags/${{ github.event.workflow_run.head_branch }}"
20+ PAYLOAD="{\"ref\":\"$REF\"}"
21+ SIGNATURE="sha256=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | cut -d' ' -f2)"
22+ RESPONSE=$(curl -sf --max-time 120 \
23+ -X POST \
24+ -H "Content-Type: application/json" \
25+ -H "X-Hub-Signature-256: $SIGNATURE" \
26+ -d "$PAYLOAD" \
27+ "https://dochub.be/webhook/dochub-deploy")
28+ echo "$RESPONSE"
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ name: Python application
33on :
44 push :
55 branches : [ main ]
6+ tags :
7+ - ' 20*'
68 pull_request :
79
810jobs :
You can’t perform that action at this time.
0 commit comments