File tree Expand file tree Collapse file tree 2 files changed +31
-30
lines changed Expand file tree Collapse file tree 2 files changed +31
-30
lines changed Original file line number Diff line number Diff line change 1
- name : Check Website Health
1
+ name : Website Health Check
2
2
3
3
on :
4
4
schedule :
5
- - cron : " */10 * * * *"
5
+ - cron : ' */5 * * * *' # Run every 5 minutes (adjust the cron schedule as needed)
6
6
7
7
jobs :
8
- check-website- health :
8
+ health-check :
9
9
runs-on : ubuntu-latest
10
-
11
10
steps :
12
- - name : Checkout code
13
- uses : actions/checkout@v2
14
-
15
- - name : Set up Go
16
- uses : actions/setup-go@v2
17
- with :
18
- go-version : 1.x
19
-
20
11
- name : Check Website Health
21
- run : go run main.go --site docfliq.com --maxretries 6
12
+ uses :
theritikchoure/[email protected]
13
+ with :
14
+ website-url : ' https://example.com'
15
+ max-retries : 3
16
+ retry-interval : 5
17
+ request-timeout : 10
Original file line number Diff line number Diff line change @@ -13,26 +13,31 @@ inputs:
13
13
description : ' Time to wait between retries in seconds (default: 5)'
14
14
required : false
15
15
default : ' 5'
16
+ request-timeout :
17
+ description : ' Request timeout in seconds (default: 10)'
18
+ required : false
19
+ default : ' 10'
20
+
21
+ branding :
22
+ icon : ' activity'
23
+ color : ' gray-dark'
16
24
17
25
outputs :
18
26
health-status :
19
27
description : ' The health status of the website (up or down)'
20
28
21
29
runs :
22
- using : ' composite'
23
- steps :
24
- - name : Setup Go
25
- uses : actions/setup-go@v2
26
- with :
27
- go-version : ' 1.16' # Use the Go version you need
28
-
29
- - name : Check out code
30
- uses : actions/checkout@v2
31
-
32
- - name : Run Websentry
33
- run : go run main.go --site ${{ inputs.website-url }} --maxretries ${{ inputs.max-retries }} --retryinterval ${{ inputs.retry-interval }} --requesttimeout ${{ inputs.request-timeout }}
34
-
35
- branding :
36
- icon : ' activity'
37
- color : ' gray-dark'
38
-
30
+ using : ' docker'
31
+ image : ' docker://golang:1.16'
32
+ args :
33
+ - /bin/sh
34
+ - -c
35
+ - |
36
+ go get -u github.com/theritikchoure/logx
37
+ go build -o /github/workspace/websentry main.go
38
+ chmod +x /github/workspace/websentry
39
+ /github/workspace/websentry \
40
+ -site ${{ inputs.website-url }} \
41
+ -maxretries ${{ inputs.max-retries }} \
42
+ -retryinterval ${{ inputs.retry-interval }} \
43
+ -requesttimeout ${{ inputs.request-timeout }}
You can’t perform that action at this time.
0 commit comments