-
-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (33 loc) · 1.15 KB
/
scheduler.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
34
35
36
37
38
39
40
41
42
name: Scheduler
on:
workflow_dispatch:
jobs:
schedule:
runs-on: ubuntu-latest
container:
image: archlinux
env:
CACTUS_CONFIG: ${{ secrets.CACTUS_CONFIG }}
steps:
- uses: arch4edu/cactus/actions/upgrade-archlinux@main
- name: Install runtime dependencies
run: pacman -S --noconfirm --needed git python-mysqlclient python-typing_extensions
- uses: arch4edu/cactus/actions/setup-cactus@main
- uses: arch4edu/cactus/actions/checkout-repository@main
- name: Scheduling
id: schedule
run: |
start_time=$(date +%s)
while [ $(( $(date +%s) - start_time )) -lt $(( 5 * 3600 )) ]; do
(cd repository; git pull --rebase)
python -m cactus.scheduler.schedule repository
current_time=$(date +%s)
program_runtime=$(($current_time - $start_time))
sleep 300
done
echo "result=success" >> $GITHUB_OUTPUT
- name: Start a new scheduler
if: ${{ always() }}
run: |
[ -z "${{ steps.schedule.outputs.result }}" ] && sleep 900
python -m cactus.scheduler.refresh