File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ name: Deploy to GitHub Pages
33on :
44 push :
55 branches : [main]
6+ workflow_call : # Allow other workflows to trigger this
67
78permissions :
89 contents : write
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ permissions:
1212jobs :
1313 check-monitors :
1414 runs-on : ubuntu-latest
15+ outputs :
16+ changes : ${{ steps.commit.outputs.changes }}
1517
1618 steps :
1719 - name : Checkout repository
3436 WEBHOOK_URL : ${{ secrets.WEBHOOK_URL }}
3537
3638 - name : Commit and push updates
39+ id : commit
3740 run : |
3841 git config --local user.email "github-actions[bot]@users.noreply.github.com"
3942 git config --local user.name "github-actions[bot]"
4043 git add data/history.json data/notification-state.json static/data/status.json
41- git diff --staged --quiet || git commit -m "Update monitor status"
42- git push
44+ if git diff --staged --quiet; then
45+ echo "changes=false" >> $GITHUB_OUTPUT
46+ else
47+ git commit -m "Update monitor status"
48+ git push
49+ echo "changes=true" >> $GITHUB_OUTPUT
50+ fi
51+
52+ deploy :
53+ needs : check-monitors
54+ if : needs.check-monitors.outputs.changes == 'true'
55+ uses : ./.github/workflows/deploy.yml
You can’t perform that action at this time.
0 commit comments