-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.51 KB
/
main.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
name: sqlupdate
on:
push:
branches:
- updatesql
paths:
- Database/Register/datum/addbook.txt
jobs:
update-db:
runs-on: ubuntu-latest
steps:
# 1. Checkout the `updatesql` branch
- name: Checkout updatesql branch
uses: actions/checkout@v2
with:
ref: updatesql
fetch-depth: 0
# 2. Set up Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.12"
# 3. Install dependencies
- name: Install Python dependencies
run: |
pip install SQLAlchemy bs4 requests
# 4. Run the Python script
- name: Run Python program
run: |
python -m Database.Register.register_actions
# 5. Checkout the `release` branch
- name: Checkout release branch
run: |
git fetch origin release
git checkout release
# 6. Copy `Database/ompooscores.db` from `updatesql` branch
- name: Copy updated ompooscores.db from updatesql
run: |
git checkout updatesql -- Database/ompooscores.db
# 7. Commit and push changes to `release`
- name: Commit and push changes
run: |
git config --global user.name "${{ secrets.GITHUBNAME }}"
git config --global user.email "${{ secrets.EMAIL }}"
git add Database/ompooscores.db
git commit -m "Update ompooscores.db after Python script execution" || echo "No changes to commit"
git push origin release