-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 1.67 KB
/
repo.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Repo Traffic - Data & figures
on:
schedule:
- cron: '0 0 1,11,21 * *' # Runs 1st, 11th, and 21st of every month
workflow_dispatch:
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
pip install requests pandas matplotlib seaborn
- name: Run script
env:
OWNER: 'demidenm' # GitHub repo owner
REPO: 'PyReliMRI' # GitHub repo name
MY_ACCESS_TOKEN: ${{ secrets.REPO_A_ACCESS_TOKEN }} # Settings -> Secrets and variables -> Actions -> New Repository secret
run: |
python git_traffik/repo_check-traffic.py
- name: List files in output directory
run: |
ls -alh git_traffik/output/
- name: Upload output files
uses: actions/upload-artifact@v4
with:
name: output-files
path: git_traffik/output/*
- name: Config Git
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
- name: Check git status
run: |
git status
- name: Add files
run: |
git add git_traffik/output/*
git status
- name: Commit files
run: |
git commit -m "Add generated files to output directory" || echo "No changes to commit"
continue-on-error: true
- name: Force push changes # This way files are always updated if their hashes differ
run: |
git push origin main --force
env:
GITHUB_TOKEN: ${{ secrets.REPO_A_ACCESS_TOKEN }}