-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (42 loc) · 1.33 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
name: Update file(s)
on:
push:
branches: [ main ]
schedule:
- cron: "0 */12 * * *" # run every 2 hours
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Format code
run: black simple.py
- name: Fetch data and update the file(s)
run: python simple.py
- name: Commit updated file(s) back to this repository
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git diff-index --quiet HEAD || git commit -m "[skip ci] Save result of action"
git fetch origin main
git push
# - name: Push file to remote repo
# uses: dmnemec/copy_file_to_another_repo_action@main
# env:
# API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
# with:
# source_file: nepse_simple.xlsx
# destination_repo: dotehacker/dotehacker.github.io
# user_name: dotehacker
# user_email: rockerritesh4@gmail.com
# target-branch: main