-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (49 loc) · 1.34 KB
/
cron.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
39
40
41
42
43
44
45
46
47
48
49
50
name: Daily Refresh
on:
schedule:
- cron: '15 0,8,16 * * *'
workflow_dispatch:
inputs:
args:
description: "Additional arguments"
required: false
default: ""
jobs:
build:
name: Refresh
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Check out code
uses: actions/checkout@v3
- name: Cache go module
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: go build -o target/gadio-rss
- name: Execute Binray
run: ./target/gadio-rss -T ${{ secrets.BOT_KEY }} ${{ github.event.inputs.args }}
- name: Artifact Database
uses: actions/upload-artifact@v3
with:
path: record.db
retention-days: 1
- name: Self-Push
shell: bash
run: |
if [[ $(git ls-files -m) ]]; then
git config user.name diov-bot
git config user.email [email protected]
git add .
git commit -a -m "Update record (Github Action)"
git push
else
echo "nothing to commit, working tree clean"
fi