-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess_patterns_from_queue.yaml
More file actions
45 lines (40 loc) · 1.54 KB
/
process_patterns_from_queue.yaml
File metadata and controls
45 lines (40 loc) · 1.54 KB
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
44
45
name: Process Patterns From Queue
## This workflow pops a pattern idea from the queue and processes it in the product pipeline
on:
# schedule:
# - cron: "0 17 * * 1-5" # Runs at noon EST (5 PM UTC) on weekdays
workflow_dispatch:
jobs:
send_request:
runs-on: ubuntu-latest
steps:
- name: Healthcheck
run: |
healthcheck_response=$(curl -s -X GET "$HEALTHCHECK_URL" -H "Authorization: Bearer $TOKEN")
echo "Healthcheck Response: $healthcheck_response"
status=$(echo "$healthcheck_response" | jq -r '.status')
if [ "$status" != "OK" ]; then
echo "Healthcheck failed with status: $status"
exit 1
fi
env:
HEALTHCHECK_URL: ${{ secrets.HEALTHCHECK_URL }}
TOKEN: ${{ secrets.API_TOKEN }}
- name: Send request to URL
run: |
response=$(curl -w "%{http_code}" -o /dev/null -s -X GET "$URL" -H "Authorization: Bearer $TOKEN")
if [ "$response" -ne 200 ]; then
echo "Request failed with status code $response"
exit 1
fi
env:
URL: ${{ secrets.PATTERN_POP_URL }}
TOKEN: ${{ secrets.API_TOKEN }}
- name: Get pattern queue count
run: |
count_response=$(curl -s -X GET "$COUNT_URL" -H "Authorization: Bearer $TOKEN")
count=$(echo "$count_response" | jq '.count')
echo "Pattern Queue Count: $count"
env:
COUNT_URL: ${{ secrets.PATTERN_COUNT_URL }}
TOKEN: ${{ secrets.API_TOKEN }}