-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (42 loc) · 1.42 KB
/
Copy pathrefresh-data.yaml
File metadata and controls
51 lines (42 loc) · 1.42 KB
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 Projects JSON
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
update-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests
- name: Update projects.json
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: python scripts/update_projects.py
- name: Check for changes
id: git_status
run: |
git diff --quiet public/projects.json || echo "changes=true" >> $GITHUB_OUTPUT
- name: Commit and push changes if needed
if: steps.git_status.outputs.changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add public/projects.json
git commit -m 'Update projects.json with latest GitHub data'
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/AI4REALNET/.github.io.git
git push
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Trigger deployment workflow
if: steps.git_status.outputs.changes == 'true'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GH_TOKEN }}
event-type: update-project-data