forked from superlinked/VectorHub
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.41 KB
/
data-fetch-push.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
name: Update Stars, Pulls and Downloads From APIs
on:
schedule:
- cron: '0 8 * * 1' # Runs at 8:00 AM every Monday
workflow_dispatch:
jobs:
fetchAndUpdate:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.DATA_PUSH_TOKEN }}
- name: Add dependencies
run: |
python -m pip install requests
python -m pip install tqdm
python -m pip install pypistats
- name: Set pepy.tech API key
run: |
echo "PYPI_API_KEY=${{ secrets.PYPI_API_KEY }}" >> $GITHUB_ENV
- name: Update files after fetching data from APIs
run: |
python docs/tools/vdb_table/fetch-data.py
- name: Commit and push if there are changes
env:
GIT_AUTHOR_NAME: Arunesh Singh
GIT_AUTHOR_EMAIL: 43724007+AruneshSingh@users.noreply.github.com
GIT_COMMITTER_NAME: Arunesh Singh
GIT_COMMITTER_EMAIL: 43724007+AruneshSingh@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.DATA_PUSH_TOKEN }}
run: |
git add docs/tools/vdb_table/data/.
git commit -m "Update Stars, Pulls & Downloads" || exit 0 # Exit 0 if no changes
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.DATA_PUSH_TOKEN }}