-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (51 loc) · 1.45 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
51
52
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@v5
with:
go-version: 'stable'
- name: Check out code
uses: actions/checkout@v4
- name: Cache go module
uses: actions/cache@v4
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 }} -A ${{ secrets.S3_ACCOUNT }} \
-K ${{ secrets.S3_KEY_ID }} -S ${{ secrets.S3_KEY_SECRET }} ${{ github.event.inputs.args }}
- name: Artifact Database
uses: actions/upload-artifact@v4
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