-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.22 KB
/
deploy-on-instawp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Call Instawp Webhook
on:
push:
branches:
- instawp # Trigger only on push to the instawp branch
jobs:
trigger-webhook:
runs-on: ubuntu-latest
strategy:
matrix:
webhook_name:
- INSTAWP_SITE_WEBHOOK
steps:
- name: Check if the secret exists
id: check_secret
run: |
if [[ -z "${{ secrets[matrix.webhook_name] }}" ]]; then
exit 1; # Exit with a non-zero status to indicate failure
fi
- name: Send webhook request for ${{ matrix.webhook_name }}
if: success() # This ensures the step only runs if the secret check passed
uses: fjogeleit/http-request-action@v1.4.0
with:
url: ${{ secrets[matrix.webhook_name] }}
method: POST
contentType: application/json
data: |
{
"ref": "${{ github.ref }}",
"repository": {
"name": "${{ github.repository }}",
"full_name": "${{ github.repository }}",
"owner": {
"login": "${{ github.actor }}"
}
},
"pusher": {
"name": "${{ github.actor }}"
}
}