Files
magpie/.github/workflows/docker-daily.yml
T
yetone 650bf84128 docker: a daily tag that moves once a day, for Renovate
magpie releases many times a day, and YaoFur on X runs the image with
Renovate, which opened a PR on every tag ("改成每天凌晨更新一次").
Releases stay as fast as they are. ghcr.io/yetone/magpie:daily is new:
.github/workflows/docker-daily.yml points it at :latest's image once a
day, at 20:00 UTC (04:00 in China), by digest, as docker-stable.yml does
for :stable. It never builds, and touches no other tag; a click on Run
workflow moves it too. A Renovate user follows daily with its digest
pinned and gets at most one PR a day; stable is still there for one a
week.

The docs name it: the Tags row and the Updates line of the Docker page in
en, zh and ja, and the Docker section of docs/reference.md.
site/docker-tags.test.mjs holds that the three languages name the same
floating tags with daily among them, that a workflow writes each tag the
docs name, and that daily has one daily schedule, copies latest and
builds nothing.

The desktop app is unchanged: it already checks every 6 hours by
default, and Settings > About offers Check every 24 h and the Stable
channel (one a week).

Run (mote): node --test site/*.test.mjs, 90 of 90 ok; without the
workflow and the docs, two of docker-tags' three tests are red.
actionlint on docker-daily.yml and docker-stable.yml: clean. No Go file
changed; go test ./... -timeout 45m runs on the Linux box (wsl-run) at
this tree, since mote had another session's full suite running.
Not tried: the workflow itself before this push; it is run once with
workflow_dispatch right after it.
2026-11-06 20:52:29 +08:00

54 lines
1.8 KiB
YAML

name: Docker daily
# ghcr.io/yetone/magpie:daily is the newest release's image, moved once a
# day: magpie releases many times a day, and Renovate opened a PR for each
# one (YaoFur on X, "改成每天凌晨更新一次"). At 20:00 UTC (04:00 in
# China) it points :daily at whatever :latest is then, by digest; it never
# builds, and never touches latest, stable, edge or a version's tags.
# Releases themselves go out as fast as ever.
on:
schedule:
- cron: '0 20 * * *'
workflow_dispatch:
concurrency:
group: docker-daily
cancel-in-progress: false
env:
IMAGE: ghcr.io/${{ github.repository_owner }}/magpie
jobs:
daily:
if: github.repository == 'yetone/magpie'
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Point daily at the newest release's image
run: |
set -euo pipefail
# an image is the platforms' manifests in it, however its index
# is written
digest() { docker buildx imagetools inspect "$1" --format '{{json .}}' | jq -er '[.manifest.manifests[]?.digest] | sort | join(",") | select(. != "")'; }
WANT=$(digest "$IMAGE:latest") # no latest image is a red run
HAVE=$(digest "$IMAGE:daily" 2>/dev/null || true)
if [[ "$HAVE" == "$WANT" ]]; then
echo "$IMAGE:daily is latest already ($WANT)"
exit 0
fi
docker buildx imagetools create -t "$IMAGE:daily" "$IMAGE:latest"
GOT=$(digest "$IMAGE:daily")
echo "$IMAGE:daily is now latest ($GOT, was ${HAVE:-none})"
test "$GOT" == "$WANT"