Files
zeekayandHanzo Dev b96e2e2f47 runs-on names a machine, not a purpose
The purpose-prefixed labels (hanzo-build-*, hanzo-deploy-*, hanzo-docs-build-*)
are retired in favour of the bare <os>-<arch> every runner already advertises.

They were not a capability, only a habit, and the habit cost builds: papers asked
for hanzo-build-linux-amd64, no online runner offered it, and two idle
linux-amd64 runners sat beside the queue while the build simply never ran. The
lux tree lost three days to lux-linux-amd64 the same way.

What a job is FOR is the workflow's name. runs-on is the machine it needs.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-15 11:36:45 -07:00

50 lines
1.9 KiB
YAML

name: deploy
# Builds hanzo.network and publishes the image the operator runs. This replaces
# the GitHub Pages workflow that used to live in .github/workflows: the site is
# served by hanzoai/static behind hanzoai/ingress, so there is no Pages and no
# Cloudflare Pages in the path.
#
# git.hanzo.ai runs this file natively. The image tag is the run's commit, and
# the operator CR in hanzoai/universe names which tag is live — a build never
# deploys itself.
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: false
jobs:
image:
# linux-amd64, not ubuntu-latest. This file lives in
# .hanzo/workflows, which GitHub never reads -- git.hanzo.ai is the only
# thing that can run it, and the fleet deliberately advertises no generic
# ubuntu-* label (~1400 mirrored forks all ask for it; one bad job was
# retried ~520 times across 10 runners). An unmatched label is not an
# error here, it is silence: the job queues until the 24h timeout, so this
# deploy has never produced an image and nothing ever said so.
runs-on: [linux-amd64]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: build and push
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -euo pipefail
if [ -z "${REGISTRY_TOKEN:-}" ]; then
echo "::error::REGISTRY_TOKEN is unset, so nothing was published. Add the org secret."
exit 1
fi
tag="$(git rev-parse --short HEAD)"
image="ghcr.io/hanzoai/hanzo-network:${tag}"
echo "${REGISTRY_TOKEN}" | docker login ghcr.io -u hanzo-dev --password-stdin
docker build -t "${image}" .
docker push "${image}"
echo "published ${image} — set spec.image.tag in universe crs/hanzo-network.yaml to ${tag}"