-
Notifications
You must be signed in to change notification settings - Fork 21
33 lines (33 loc) · 1.23 KB
/
tera-status-check.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
name: Fluid Earth Tera Status Check (job fails when status changes)
on:
schedule:
- cron: '38 * * * *'
workflow_dispatch:
jobs:
status-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Check if Fluid Earth Tera backend is up and up-to-date
run: $GITHUB_WORKSPACE/backend/scripts/status.js > $RUNNER_TEMP/out.txt
- uses: actions/cache/restore@v4
with:
path: ${{ runner.temp }}/previous-out.txt
key: tera-status-check-previous-output-${{ github.run_id }}
restore-keys: tera-status-check-previous-output-
- name: Print status check result and compare result with previous result
run: |
cat $RUNNER_TEMP/out.txt
diff $RUNNER_TEMP/previous-out.txt $RUNNER_TEMP/out.txt > /dev/null
- name: Prepare new result for cache
if: failure()
run: mv $RUNNER_TEMP/out.txt $RUNNER_TEMP/previous-out.txt
- name: Save new result to cache
if: failure()
uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/previous-out.txt
key: tera-status-check-previous-output-${{ github.run_id }}