mirror of
https://github.com/cunnie/sslip.io.git
synced 2025-12-24 12:12:48 +08:00
Claude assures me this will fix the problem. Really. Fixes, when running GitHub Action: ``` Deploy to gist [INFO] Action failed with "Error: ENOENT: no such file or directory, open '/home/runner/actions-runner/_work/sslip.io/sslip.io/tmp/qps.json'" ```
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Queries per Second shields.io badge
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 */6 * * *" # Runs every 6 hours
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update-qps-gist:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Calculate QPS
|
|
id: qps
|
|
uses: docker://cunnie/fedora-golang-bosh
|
|
with:
|
|
entrypoint: /bin/bash
|
|
args: |
|
|
-c "
|
|
for NS in ns-{do-sg,gce,hetzner,ovh}.sslip.io; do
|
|
dig TXT metrics.status.sslip.io @$NS +short |
|
|
rg \"Queries:\" |
|
|
sed 's/\"Queries.*[(]//; s~/.*$~~g'
|
|
done |
|
|
awk '{ sum += $1 } END { printf \"qps=%.0f\n\", sum }' \
|
|
> $GITHUB_OUTPUT
|
|
"
|
|
|
|
- name: Create QPS JSON file
|
|
run: |
|
|
cat > qps.json << EOF
|
|
{
|
|
"schemaVersion": 1,
|
|
"label": "Queries / second",
|
|
"message": "${{ steps.qps.outputs.qps }}",
|
|
"color": "blue"
|
|
}
|
|
EOF
|
|
|
|
- name: Update Gist with QPS data
|
|
uses: exuanbo/actions-deploy-gist@v1
|
|
with:
|
|
token: ${{ secrets.GIST_TOKEN }}
|
|
gist_id: 67dc2a78c9ac6032db05027727c63ea1
|
|
file_path: qps.json
|