Skip to content

Commit 80a6421

Browse files
authored
Merge pull request #90 from edgehero/feat/github-app-manifest-setup
setup overhaul: up/doctor --fix, service, npm publish, compose receiver, App-manifest setup, polling (#80 #81 #82)
2 parents 49e2efc + 0b9167d commit 80a6421

64 files changed

Lines changed: 7002 additions & 204 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Every image here builds with the REPO ROOT as context (image/Dockerfile, image/Dockerfile.azure,
2+
# receiver/Dockerfile), so without this file each build ships the whole working tree to the daemon --
3+
# node_modules alone is ~350 MB of upload before the first layer runs.
4+
#
5+
# Patterns are ANCHORED to the context root (dockerignore is filepath.Match, not gitignore): `docs`
6+
# matches only ./docs, and matching node_modules at any depth needs the explicit `**/`.
7+
#
8+
# What must STAY in the context is defined by the Dockerfiles' COPY lines:
9+
# image/Dockerfile: package.json, package-lock.json, image/runner, image/entrypoint.sh, guardrails/
10+
# receiver/Dockerfile: package.json, package-lock.json, .npmrc, worker/{package.json,src},
11+
# receiver/{package.json,src}
12+
# image/ is therefore NOT excluded wholesale -- the pi-job build copies image/runner verbatim (its test/
13+
# included; excluding it would silently change that image's contents), and guardrails/ is the baked
14+
# safety floor. Anything below is copied by no Dockerfile and never may be.
15+
16+
# Installed deps -- each image runs its own `npm ci` from the lockfile; a host node_modules in the
17+
# context is pure upload weight and a platform mismatch waiting to be COPY'd by accident.
18+
**/node_modules
19+
20+
# History and CI config: builds consume the working tree, never the repo.
21+
.git
22+
.github
23+
24+
# Docs, specs, planning, editor/agent tooling -- prose and provenance, not runtime.
25+
docs
26+
specs
27+
examples
28+
.plan-artifacts
29+
.pi
30+
.claude
31+
README.md
32+
SECURITY.md
33+
LICENSE
34+
35+
# The admin workspace: a pi extension in the operator's session (DES-ADMIN-VIA-PI-EXTENSION);
36+
# no image runs it.
37+
admin
38+
39+
# Deploy templates (systemd/launchd/nssm/compose) configure the HOST, not a container.
40+
deploy
41+
42+
# Tests for the workspaces whose src is copied. image/runner/test is deliberately NOT listed:
43+
# image/Dockerfile copies image/runner as a whole, and the ignore file must not edit that image.
44+
worker/test
45+
receiver/test
46+
47+
# Secrets and operator-local state. The .env never enters an image -- compose hands it to the
48+
# CONTAINER via env_file; a real secret in a LAYER is published with the image.
49+
.env
50+
.env.*
51+
triggers.json
52+
pause-windows.json
53+
pi-packages.json
54+
subscriptions.json
55+
logs
56+
jobs
57+
sessions
58+
**/*.log

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ GITHUB_AUTH_SOURCE=gh
9797
# For GITHUB_AUTH_SOURCE=pat: a repo-scoped, short-expiry fine-grained PAT
9898
GITHUB_PAT=
9999
# For GITHUB_AUTH_SOURCE=app (optional; required for multi-tenant)
100+
# `pi-dispatch setup github` fills all three in one browser click (App Manifest flow) and writes the PEM 0600
100101
GITHUB_APP_ID=
101102
GITHUB_APP_INSTALLATION_ID=
102103
GITHUB_APP_PRIVATE_KEY_PATH=
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Build and publish the receiver image to GHCR so operators `docker compose --profile receiver up` a
2+
# prebuilt multi-arch image instead of building locally. main is branch-protected (PR + 1 approving
3+
# review), so a push here is an already-approved merge — nothing in this workflow merges anything
4+
# (CONST-MERGE-NEVER-AUTOMATIC).
5+
#
6+
# The pushed image is a snapshot of the receiver AND the worker sources it imports (`@edgehero/pi-dispatch`
7+
# is a workspace dependency) at the built commit — hence the worker paths in the trigger: a change to a
8+
# shared module the receiver imports must rebuild this image even when receiver/ itself is untouched.
9+
#
10+
# No secret required: GHCR auth uses the built-in GITHUB_TOKEN (packages: write). One-time after the first
11+
# successful run: make the ghcr.io/edgehero/pi-dispatch-receiver package Public in the org's package
12+
# settings, otherwise `docker pull` needs auth.
13+
14+
name: receiver-image
15+
16+
on:
17+
push:
18+
branches: [main]
19+
paths:
20+
- "receiver/**"
21+
- "worker/src/**"
22+
- "worker/package.json"
23+
- "package-lock.json"
24+
- ".github/workflows/receiver-image.yml"
25+
# Manual re-run (available once this file is on the default branch).
26+
workflow_dispatch: {}
27+
28+
permissions:
29+
contents: read
30+
packages: write # push to ghcr.io/edgehero/*
31+
32+
concurrency:
33+
group: receiver-image
34+
cancel-in-progress: false
35+
36+
env:
37+
IMAGE: ghcr.io/edgehero/pi-dispatch-receiver
38+
39+
jobs:
40+
build-push:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: docker/setup-qemu-action@v3 # arm64 emulation for the multi-arch build
46+
- uses: docker/setup-buildx-action@v3
47+
48+
- uses: docker/login-action@v3
49+
with:
50+
registry: ghcr.io
51+
username: ${{ github.actor }}
52+
password: ${{ secrets.GITHUB_TOKEN }}
53+
54+
- name: Tags + labels
55+
id: meta
56+
uses: docker/metadata-action@v5
57+
with:
58+
images: ${{ env.IMAGE }}
59+
tags: |
60+
type=raw,value=latest
61+
type=sha
62+
63+
- name: Build + push (amd64 + arm64)
64+
uses: docker/build-push-action@v6
65+
with:
66+
context: . # repo root — the Dockerfile copies worker/ and receiver/ workspace sources from here
67+
file: receiver/Dockerfile
68+
platforms: linux/amd64,linux/arm64
69+
push: true
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}
72+
cache-from: type=gha
73+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)