File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 33 push :
44 branches : [ main ]
55 workflow_dispatch :
6+ repository_dispatch :
7+ types : [update-project-data]
68
79jobs :
810 build-and-deploy :
3638 with :
3739 folder : dist
3840 branch : gh-pages
39- clean : true
41+ clean : true
Original file line number Diff line number Diff line change @@ -26,12 +26,26 @@ jobs:
2626 GH_TOKEN : ${{ secrets.GH_TOKEN }}
2727 run : python scripts/update_projects.py
2828
29+ - name : Check for changes
30+ id : git_status
31+ run : |
32+ git diff --quiet public/projects.json || echo "changes=true" >> $GITHUB_OUTPUT
33+
2934 - name : Commit and push changes if needed
35+ if : steps.git_status.outputs.changes == 'true'
3036 run : |
3137 git config --global user.name 'github-actions[bot]'
3238 git config --global user.email 'github-actions[bot]@users.noreply.github.com'
33- git diff --exit-code || (git add public/projects.json && git commit -m 'Update projects.json with latest GitHub data' && \
34- git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/AI4REALNET/.github.io.git && \
35- git push)
39+ git add public/projects.json
40+ git commit -m 'Update projects.json with latest GitHub data'
41+ git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/AI4REALNET/.github.io.git
42+ git push
3643 env :
37- GH_TOKEN : ${{ secrets.GH_TOKEN }}
44+ GH_TOKEN : ${{ secrets.GH_TOKEN }}
45+
46+ - name : Trigger deployment workflow
47+ if : steps.git_status.outputs.changes == 'true'
48+ uses : peter-evans/repository-dispatch@v2
49+ with :
50+ token : ${{ secrets.GH_TOKEN }}
51+ event-type : update-project-data
You can’t perform that action at this time.
0 commit comments