You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository ships a GitHub Action implemented in Go.
4
4
@@ -11,9 +11,12 @@ This repository ships a GitHub Action implemented in Go.
11
11
## Go Tooling
12
12
- Go commands should be run via `mise` for toolchain consistency.
13
13
- Examples:
14
+
-`make test`
15
+
-`make dist`
14
16
-`mise exec -- go test ./...`
15
17
-`mise exec -- go run ./cmd/pullpreview up examples/example-app`
16
-
-`make dist`
18
+
- Always run `make dist` before pushing source changes so the bundled CLI binary stays in sync.
19
+
-`make dist` builds the prebuilt Linux binary under `dist/` and auto-commits only that directory via the repo’s `dist-commit` target.
17
20
- Dist workflow:
18
21
- Commit source changes first.
19
22
- Run `make dist` afterwards.
@@ -29,22 +32,26 @@ Supported commands:
29
32
-`pullpreview list org/repo`
30
33
-`pullpreview github-sync path/to/app`
31
34
35
+
## Providers
36
+
- Default provider: `lightsail`.
37
+
- Supported providers: `lightsail`, `hetzner`.
38
+
- Provider discovery is via `internal/providers` registrations.
39
+
- New Hetzner provider is implemented in `internal/providers/hetzner`.
40
+
-`providers` package uses typed environment config parsing and factory registration.
41
+
32
42
## Deploy behavior (`up`)
33
-
- Launches/restores Lightsail instance and waits for SSH.
34
-
- Uploads authorized keys.
35
-
- Renders compose config, rewrites relative bind mounts under `app_path` to `/app/...`, and syncs only those bind-mounted local paths to the server via `rsync`.
36
-
- Deploys through Docker context to the remote engine.
37
-
- Executes `pre_script` inline over SSH before `docker compose up` (script must be self-contained).
38
-
- Optional automatic HTTPS proxying via Caddy + Let's Encrypt when `proxy_tls` is set.
39
-
- Format: `service:port` (for example `web:80`).
40
-
- Forces preview URL/output to HTTPS on port `443`.
41
-
- Opens firewall port `443` and suppresses firewall exposure for port `80`.
42
-
- Injects `pullpreview-proxy` service unless host port `443` is already published (then it logs a warning and skips proxy injection).
43
-
- Emits periodic heartbeat logs with:
43
+
- Launches/restores an instance via provider abstraction.
44
+
- Waits for SSH and runs provider-generated user-data.
45
+
- Uploads authorized SSH keys.
46
+
- Renders compose config, rewrites relative bind mounts under `app_path` to `/app/...`, and syncs only detected bind-mounted local paths via `rsync`.
47
+
- Deploys through Docker context on remote engine.
48
+
- Executes `pre_script` inline over SSH before `docker compose up`.
49
+
- Optional HTTPS via `proxy_tls` injects a Caddy sidecar and adjusts logging/port exposure.
-`internal/providers`: provider registry and concrete providers
75
105
-`internal/github`: GitHub API wrapper
76
106
-`internal/license`: license check client
77
107
-`dist/`: bundled Linux amd64 binary used by the action
78
108
79
109
## Repo-local skill
80
110
-`skills/pullpreview-demo-flow/SKILL.md`: repeatable end-to-end demo capture workflow (PR open/label/deploy/view deployment/unlabel/destroy) with strict screenshot requirements and fixed demo PR title.
111
+
112
+
## Review status (current branch)
113
+
- Live provider validation has been run against Hetzner using `.env` with `HCLOUD_TOKEN` plus CLI/action values (`--region nbg1`, `instance_type cpx21`, `--image ubuntu-24.04`).
114
+
-`up`, `down`, and `list` flows have been exercised.
115
+
- Follow-up cleanup items:
116
+
- tighten `RunDown` context-name parser to avoid stripping legitimate names that resemble context suffix format
117
+
- make create-failure cleanup continue best-effort cache/key cleanup if server delete fails
|`registries`|`""`| Private registry credentials, e.g. `docker://user:password@ghcr.io`. |
129
131
|`proxy_tls`|`""`| Automatic HTTPS forwarding with Caddy + Let's Encrypt (`service:port`, e.g. `web:80`). |
130
132
|`pre_script`|`""`| Path to a local shell script (relative to `app_path`) executed inline over SSH before compose deploy (should be self-contained). |
@@ -135,7 +137,16 @@ Notes:
135
137
-`proxy_tls` forces URL/output/comment links to HTTPS on port `443`, injects a Caddy proxy service, and suppresses firewall exposure for port `80`. **When using `proxy_tls`, it is strongly recommended to set `dns` to a [custom domain](https://github.com/pullpreview/action/wiki/Using-a-custom-domain) or one of the built-in `revN.click` alternatives** to avoid hitting shared Let's Encrypt rate limits on `my.preview.run`.
136
138
-`admins: "@collaborators/push"` uses GitHub API collaborators with push permission (first page, up to 100 users; warning is logged if more exist).
137
139
- SSH key fetches are cached between runs in the action cache.
140
+
- For Hetzner, configure credentials and defaults via action inputs and environment: `HCLOUD_TOKEN` (required), `HETZNER_CA_KEY` (required), optional `region` and `image` (`region` defaults to `nbg1`, `image` defaults to `ubuntu-24.04`). `instance_type` defaults to `cpx21` when provider is Hetzner.
141
+
-`HETZNER_CA_KEY` must be an SSH private key (RSA or Ed25519) for the instance-access CA. PullPreview signs a per-run ephemeral login key with this CA key and uses SSH certificates (`...-cert.pub`) instead of reusing a persistent private key across runs.
142
+
- Generate a CA key once for your repository secret:
-**Let's Encrypt rate limits**: Let's Encrypt allows a maximum of [50 certificates per registered domain per week](https://letsencrypt.org/docs/rate-limits/#new-certificates-per-registered-domain). If you use `proxy_tls` and hit this limit on the default `my.preview.run` domain, switch to one of the built-in alternatives: `rev1.click`, `rev2.click`, ... `rev9.click`. Set `dns: rev1.click` in your workflow inputs. You can also use a [custom domain](https://github.com/pullpreview/action/wiki/Using-a-custom-domain).
149
+
- For local CLI runs, set `HCLOUD_TOKEN` and `HETZNER_CA_KEY` (for example via `.env`) when using `provider: hetzner` to avoid relying on action inputs.
0 commit comments