Give a Docker stack that runs on a GitHub Actions runner a public HTTPS link (Cloudflare quick tunnel), keep it up for N minutes, watch it, and keep its Postgres database between runs. No server, no account other than GitHub. Good for: showing a work-in-progress to a client, a recruiter test that must be reachable for an afternoon, pull-request previews. Not for: permanent hosting (a run lives at most 6 hours and the link changes every run).
jobs:
preview:
runs-on: ubuntu-latest
permissions: { contents: write } # only needed for the saved database
steps:
- uses: actions/checkout@v4
- run: docker compose up -d --wait # your stack; something must listen on a local port
- uses: flisk-sh/live-preview@v1
with:
origin: http://127.0.0.1:8080 # where the app listens on the runner
minutes: 120
# optional: keep the database between runs
pg-container: my-db
state-key: ${{ secrets.STATE_KEY }} # any long random string; keep it the same between runsThe link is printed in the log and the job summary, and is the url output.
- Installs
cloudflared, opens a quick tunnel tooriginand waits until the public name answershealth-path. - Every 30 s checks the public link (and
health-cmd, e.g. adocker execprobe). After 3 failures in a row it opens a new tunnel (new link, up to 5 times). - With
pg-container: restores the last saved database before the app is used, saves it (encrypted with AES-256, keystate-key) every 2 minutes when it changed and when the run ends. The copy is the only commit of branchlive-preview-stateof your repository. A wrong key stops the run instead of overwriting data.
- Runs on x86_64 (
ubuntu-latest) and arm64 (ubuntu-24.04-arm) runners: the cloudflared package is picked fromuname -m, and any other architecture stops the install step with an error that names it. - The restore runs when the action starts, after your stack is up. If your app caches the schema at start,
restart it after the restore (or restore from your own step by running
scripts/state.sh restorefirst). - Use the same
state-keyevery time. Treat the branch as private data: use it only in private repositories unless you accept an encrypted copy being public. - Quick tunnels are for testing: no uptime promise from Cloudflare, no custom domain.
- Several runs at once: add
concurrency: { group: live-preview, cancel-in-progress: false }to your job.
The self-test workflow in this repository runs the whole thing twice on clean runners and fails if the row written by
the first run is missing in the second.
.github/workflows/flisk-wolf.yml runs a small model behind an API portal on a runner and puts this action in front of it. Run it with Actions → flisk-wolf → Run workflow, then read the link in the job summary and call it:
curl https://<the-link>.trycloudflare.com/v1/chat/completions \
-H "Authorization: Bearer $WOLF_API_KEY" -H 'Content-Type: application/json' \
-d '{"model":"flisk-wolf","messages":[{"role":"user","content":"Write a Flisk service.json for a worker called emailer in the shop stack."}]}'The repository secret WOLF_API_KEY is the only key the portal accepts. The runner has no GPU, so a reply takes tens of seconds, and the model is downloaded again on every run (about 6 GB). The portal comes from flisk-inference.