-
Notifications
You must be signed in to change notification settings - Fork 0
/
site-status.yaml
38 lines (33 loc) · 1.36 KB
/
site-status.yaml
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
name: Site Status
on:
pull_request:
branches:
- 'master'
- 'main'
jobs:
deployment-availability:
name: Deployment Availability
runs-on: ubuntu-latest
steps:
- name: Update & Setup Environment
id: setup
run: "sudo apt-get -qq update && sudo apt-get -qq install jq -y"
- name: Verify Deployment Availability
id: site-status
run: |
STATUS=$(curl -s https://raw.githubusercontent.com/Fairbanks-io/site-status/main/deployments.json | jq -r .status)
REASON=$(curl -s https://raw.githubusercontent.com/Fairbanks-io/site-status/main/deployments.json | jq -r .reason)
ADMINS=$(curl -s https://raw.githubusercontent.com/Fairbanks-io/site-status/main/deployments.json | jq -r .admins)
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "${ADMINS[@]}" =~ "${PR_AUTHOR}" ]]; then
echo "[SKIP] $PR_AUTHOR is a member of site-status/deployments admins; skipping verification..."
exit 0
fi
if [[ "$STATUS" == "enabled" ]]; then
echo "[OK] Deployments are currently available"
exit 0
else
echo "[ERROR] Deployments are NOT currently available; please try again later."
echo "[ERROR] ${REASON}"
exit 1
fi