-
Notifications
You must be signed in to change notification settings - Fork 790
69 lines (61 loc) · 1.78 KB
/
update.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#
# Copyright (C) 2022 Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Update
on:
workflow_dispatch:
inputs:
push:
description: 'push'
default: false
type: boolean
config:
description: 'update configs'
default: true
type: boolean
rss:
description: 'update rss'
default: true
type: boolean
jobs:
configs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Initialization environment
run : |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
sudo apt update
sudo apt install -y libxml2-utils
pip install requests BeautifulSoup4 pyyaml
- name: update pats
run: |
python rssupdate.py ${{ inputs.config }} ${{ inputs.rss }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: configs
path: |
files/board/arpl/overlayfs/opt/arpl/model-configs
rss.json
rss.xml
- name: Check and Push
if: success() && inputs.push == true
run: |
git pull
status=$(git status -s | grep -E 'model-configs|rss' | awk '{printf " %s", $2}')
if [ -n "${status}" ]; then
git add ${status}
git commit -m "update $(date +%Y-%m-%d" "%H:%M:%S)"
git push -f
fi