Skip to content

Update Summary

Update Summary #147

name: Update Summary
on:
schedule:
- cron: '00 06 * * *'
workflow_dispatch:
repository_dispatch:
types: [updown]
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
update:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Fetch and generate summary
run: |
curl -sf "https://updown.io/api/checks?api-key=${{ secrets.UPDOWN_API_KEY }}" \
| jq '[.[] | {name: .alias, status: (if .down then "down" else "up" end), updatedAt: .last_check_at}]' \
> history/summary.json
- name: Commit if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git diff --quiet history/summary.json || \
(git add history/summary.json && git commit -m "chore: update summary" && git push)
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
path: .
- id: deployment
uses: actions/deploy-pages@v5