ci(homeflare): Homeflare's Release builds the celld image, not a push here
Jason Schwarzenberger authored 1 parent ee3f48ecommit fc99e25f7c42f52ae31cc7717582030001e59a8aBrowse files
2 files changed+7−77
deleted.github/workflows/homeflare-image.yml+0−71
| @@ -1,71 +1,0 @@ | ||
| 1 | -name: Homeflare image | |
| 2 | - | |
| 3 | -# Builds this fork's celld image and pushes it to GHCR, for Homeflare's | |
| 4 | -# runtime image to build on: | |
| 5 | -# | |
| 6 | -# ghcr.io/<owner>/celld:<first 12 of the commit> what Homeflare pins | |
| 7 | -# ghcr.io/<owner>/celld:main the latest main | |
| 8 | -# | |
| 9 | -# The Dockerfile is upstream's: the image builds only if cargo test and | |
| 10 | -# cargo clippy -D warnings pass. Layers are cached in the registry | |
| 11 | -# (:buildcache-amd64), so a patch only rebuilds what it touches. | |
| 12 | -# | |
| 13 | -# Upstream's release.yml (native binaries, ghcr.io/denoland/celld) is left as | |
| 14 | -# it is; it only runs on a `candidate` push or a published release. | |
| 15 | -on: | |
| 16 | - push: | |
| 17 | - branches: [main] | |
| 18 | - paths-ignore: | |
| 19 | - - "**.md" | |
| 20 | - - "docs/**" | |
| 21 | - - "homeflare/smoke/**" | |
| 22 | - workflow_dispatch: | |
| 23 | - | |
| 24 | -permissions: | |
| 25 | - contents: read | |
| 26 | - | |
| 27 | -concurrency: | |
| 28 | - group: homeflare-image-${{ github.ref }} | |
| 29 | - cancel-in-progress: true | |
| 30 | - | |
| 31 | -jobs: | |
| 32 | - image: | |
| 33 | - name: Build and push | |
| 34 | - # GHCR takes GitHub's token only: a mirror (git.1j.nz) has its own forge's. | |
| 35 | - if: github.server_url == 'https://github.com' | |
| 36 | - runs-on: ubuntu-22.04 | |
| 37 | - timeout-minutes: 120 | |
| 38 | - permissions: | |
| 39 | - contents: read | |
| 40 | - packages: write | |
| 41 | - steps: | |
| 42 | - - uses: actions/checkout@v6 | |
| 43 | - | |
| 44 | - - uses: docker/setup-buildx-action@v3 | |
| 45 | - | |
| 46 | - - name: Log in to GHCR | |
| 47 | - env: | |
| 48 | - GHCR_TOKEN: ${{ github.token }} | |
| 49 | - run: | | |
| 50 | - printf '%s' "$GHCR_TOKEN" | | |
| 51 | - docker login ghcr.io --username "$GITHUB_ACTOR" --password-stdin | |
| 52 | - | |
| 53 | - - name: Build, test and push | |
| 54 | - run: | | |
| 55 | - set -euo pipefail | |
| 56 | - image="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/celld" | |
| 57 | - version=$(sed -n 's/^version = "\(.*\)"$/\1/p' crates/celld/Cargo.toml | head -1) | |
| 58 | - docker buildx build \ | |
| 59 | - --platform linux/amd64 \ | |
| 60 | - --build-arg "CELLD_COMMIT=$GITHUB_SHA" \ | |
| 61 | - --build-arg "CELLD_VERSION=$version" \ | |
| 62 | - --label "org.opencontainers.image.source=https://github.com/$GITHUB_REPOSITORY" \ | |
| 63 | - --cache-from "type=registry,ref=$image:buildcache-amd64" \ | |
| 64 | - --cache-to "type=registry,ref=$image:buildcache-amd64,mode=max" \ | |
| 65 | - --tag "$image:${GITHUB_SHA::12}" \ | |
| 66 | - --tag "$image:main" \ | |
| 67 | - --push \ | |
| 68 | - . | |
| 69 | - echo "### Pushed \`$image:${GITHUB_SHA::12}\`" >> "$GITHUB_STEP_SUMMARY" | |
| 70 | - echo "" >> "$GITHUB_STEP_SUMMARY" | |
| 71 | - echo "Homeflare: \`HOMEFLARE_CELLD_IMAGE=$image:${GITHUB_SHA::12}\`" >> "$GITHUB_STEP_SUMMARY" |
modifiedHOMEFLARE.md+7−6View file
| @@ -37,12 +37,13 @@ | ||
| 37 | 37 | |
| 38 | 38 | ## Building |
| 39 | 39 | |
| 40 | -Each push to `main` builds `ghcr.io/jason-s13r/celld:<first 12 of the commit>` | |
| 41 | -(and `:main`) with `.github/workflows/homeflare-image.yml`. Homeflare's runtime | |
| 42 | -image builds on one of these, pinned in its `deploy/runtime/Containerfile`; | |
| 43 | -`HOMEFLARE_CELLD_IMAGE` in `homeflare.env` picks another. To build celld from | |
| 44 | -source instead, set `HOMEFLARE_CELLD_SOURCE` to a git URL (see Homeflare's | |
| 45 | -README). By hand, with Podman: | |
| 40 | +Homeflare pins a commit of this repository in its `deploy/runtime/Containerfile` | |
| 41 | +(`ghcr.io/jason-s13r/homeflare-celld:<first 12 of the commit>`). Homeflare's | |
| 42 | +Release builds that image from this repository the first time it's pinned and | |
| 43 | +publishes it; its `install.sh` pulls it, or builds it when it isn't published. | |
| 44 | +`HOMEFLARE_CELLD_IMAGE` in `homeflare.env` picks another image, and | |
| 45 | +`HOMEFLARE_CELLD_SOURCE` builds from a git URL or a local checkout (see | |
| 46 | +Homeflare's README). By hand, with Podman: | |
| 46 | 47 | |
| 47 | 48 | ```sh |
| 48 | 49 | podman build -t localhost/homeflare-celld:dev \ |