-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add uptime robot functionality
- Loading branch information
Showing
3 changed files
with
108 additions
and
60 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,39 @@ | ||
name: Test | ||
name: Deploy with Monitor Control | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
STATUSCAKE_MONITOR_IDS: '7006566,7172927' | ||
UPTIMEROBOT_MONITOR_IDS: '787122950,779173736' | ||
|
||
jobs: | ||
test: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Pause monitor | ||
uses: ./ # Uses an action in the root directory | ||
with: | ||
statuscake_api_token: ${{ secrets.STATUSCAKE_API_TOKEN }} | ||
statuscake_monitor_ids: ${{ secrets.STATUSCAKE_MONITOR_IDS }} | ||
action: 'pause' | ||
- name: Pause Monitoring | ||
uses: ./ | ||
with: | ||
action: pause | ||
statuscake_monitor_ids: ${{ env.STATUSCAKE_MONITOR_IDS }} | ||
uptimerobot_monitor_ids: ${{ env.UPTIMEROBOT_MONITOR_IDS }} | ||
statuscake_api_token: ${{ secrets.STATUSCAKE_API_TOKEN }} | ||
uptimerobot_api_key: ${{ secrets.UPTIMEROBOT_API_KEY }} | ||
|
||
- name: Wait for 30 seconds | ||
run: sleep 30 | ||
- name: Simulate Deployment | ||
run: | | ||
echo "Starting deployment..." | ||
sleep 30 | ||
echo "Deployment completed." | ||
- name: Restart monitor | ||
uses: ./ # Uses an action in the root directory | ||
with: | ||
statuscake_api_token: ${{ secrets.STATUSCAKE_API_TOKEN }} | ||
statuscake_monitor_ids: ${{ secrets.STATUSCAKE_MONITOR_IDS }} | ||
action: 'restart' | ||
- name: Resume Monitoring | ||
uses: ./ | ||
with: | ||
action: resume | ||
statuscake_monitor_ids: ${{ env.STATUSCAKE_MONITOR_IDS }} | ||
uptimerobot_monitor_ids: ${{ env.UPTIMEROBOT_MONITOR_IDS }} | ||
statuscake_api_token: ${{ secrets.STATUSCAKE_API_TOKEN }} | ||
uptimerobot_api_key: ${{ secrets.UPTIMEROBOT_API_KEY }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
name: "StatusCake Monitor Control" | ||
description: "Pauses and restarts one or more StatusCake monitors" | ||
author: "Clive Walkden" | ||
name: 'StatusCake and UptimeRobot Monitor Control' | ||
description: 'Pause/Resume monitoring for StatusCake and UptimeRobot during deployments' | ||
author: 'Clive Walkden, Darshan Gada' | ||
branding: | ||
icon: "check-circle" | ||
color: "green" | ||
icon: 'check-circle' | ||
color: 'green' | ||
inputs: | ||
statuscake_api_token: | ||
description: "StatusCake API token" | ||
required: true | ||
statuscake_monitor_ids: | ||
description: "Comma-separated list of StatusCake monitor IDs" | ||
required: true | ||
description: 'Comma-separated list of StatusCake monitor IDs' | ||
required: false | ||
uptimerobot_monitor_ids: | ||
description: 'Comma-separated list of UptimeRobot monitor IDs' | ||
required: false | ||
action: | ||
description: "'pause' to pause the monitor, 'restart' to restart the monitor" | ||
description: 'Action to perform (pause or resume)' | ||
required: true | ||
statuscake_api_token: | ||
description: 'StatusCake API token' | ||
required: false | ||
uptimerobot_api_key: | ||
description: 'UptimeRobot API key' | ||
required: false | ||
runs: | ||
using: "node20" | ||
main: "dist/index.js" | ||
using: 'node20' | ||
main: 'dist/index.js' |
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