Repository navigation
Add Docker Compose and CI static publish as alternatives to install.sh - #29
Conversation
Let Windows/WSL users run official Ghost 6 in Compose with content in ~/.ghost, keep deploy.sh/gssg on the host, and generate GitHub Pages from Actions without changing the Ghost-CLI install path. Co-authored-by: Fernando Paladini <fnpaladini@gmail.com>
There was a problem hiding this comment.
🟡 Changes recommended
Approval is blocked by a critical CI supply-chain risk involving mutable upstream code with publishing credentials, along with two moderate issues causing misleading uninstall status and stale helper logic on reruns.
3 open issues
What changed in this PR
This pull request adds Docker Compose as an optional Ghost runtime and introduces a reusable GitHub Actions workflow for generating and publishing static sites to GitHub Pages while preserving the existing install.sh and deploy.sh paths.
Changes:
- Added Compose configuration, setup, export, smoke-test, and Docker-aware helper scripts.
- Added reusable Pages publishing workflow, example configuration, and CI validation.
- Updated documentation, contribution guidance, changelog, and repository housekeeping.
| File | Description |
|---|---|
| tests/run-compose-tests.sh | Adds checks for Compose configuration and workflow fixtures. |
| scripts/export-static.sh | Exports and validates static files without pushing them. |
| scripts/compose-smoke.sh | Validates and optionally starts the Docker Compose stack. |
| scripts/compose-setup.sh | Prepares the Docker-based Ghost installation layout under ~/.ghost. |
| readme.md | Links users to the Docker and CI documentation. |
| install.sh | Installs the static export helper for Ghost-CLI users. |
| includes/uninstall.sh | Adds Docker Compose-aware uninstall handling. |
| includes/lib/common.sh | Adds configurable paths, Docker detection, and runtime readiness helpers. |
| examples/github/publish-static.yml | Provides an example caller for the reusable publishing workflow. |
| docs/v3/REQUIREMENTS.md | Documents Docker Compose as an alternative requirement. |
| docs/v3/GETTING-STARTED.md | Adds the Docker setup path to the getting-started guidance. |
| docs/v3/DOCKER.md | Documents Compose setup, configuration, publishing, and persistence. |
| docs/v3/DEPLOY.md | Documents Docker and CI publishing alternatives. |
| docs/v3/CI.md | Documents the reusable static publishing workflow. |
| docs/TROUBLESHOOTING.md | Adds Docker Compose troubleshooting guidance. |
| docs/README.md | Links to the new Docker and CI documentation. |
| docs/GLOSSARY.md | Defines Docker Compose and GitHub Actions terminology. |
| CONTRIBUTING.md | Adds Compose checks and new project areas to contributor guidance. |
| compose.yaml | Defines the official Ghost 6 Compose service and persistent content mount. |
| CHANGELOG.md | Records the new Docker and CI publishing features. |
| .gitignore | Ignores local Compose content and scratch files. |
| .github/workflows/publish-static.yml | Implements reusable static export and GitHub Pages deployment. |
| .github/workflows/ci.yml | Runs Compose fixture, workflow lint, and smoke checks. |
| .env.example | Documents Compose environment variables. |
Review effort: Lite
|
|
||
| - name: Lint GitHub Actions workflows | ||
| run: | | ||
| bash <(curl --fail --silent --show-error --location https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) |
| if [ -f "${GHOST_INSTALL}/.docker" ]; then | ||
| if command -v docker >/dev/null 2>&1 && [ -f "${GHOST_INSTALL}/compose.yaml" ]; then | ||
| (cd "$GHOST_INSTALL" && docker compose down) || true | ||
| fi | ||
| echo "[INFO] Docker Compose Ghost was stopped. Your files are still in ${GHOST_INSTALL}." |
|
|
||
| cp "${ROOT}/includes/deploy.sh" "${GHOST_INSTALL}/" | ||
| cp "${ROOT}/includes/uninstall.sh" "${GHOST_INSTALL}/" | ||
| cp -R "${ROOT}/includes/lib" "${GHOST_INSTALL}/lib" |
ReviewThe direction matches issue #28: Compose stays an alternative to Blocking
Non-blocking
Checks
Issue #28 is the right tracker for this work. It is not in the PR's closing-issue references. I did not edit the PR body. Adding |
SQLite now lives on the content mount, Compose uses one project name, and the Pages workflow stops when the blog content directory is missing.
gssg 1.1.4 needs --url, and wget's HTTP error status was aborting the crawl before localhost links were replaced.
paladini
left a comment
There was a problem hiding this comment.
Follow-up
The blockers in the earlier review are fixed on 5ecdeb6. This is not an approval.
- SQLite now stays on the content mount (
database__client=sqlite3anddatabase__connection__filename=/var/lib/ghost/content/data/ghost.db). CI smoke checks that the hostghost.dbexists. gssg1.1.4 is called with--url.--productionDomainis ignored by that release, and wget exit 8 was aborting the crawl before localhost links were rewritten.- An empty Pages publish is refused unless
allow_emptyis set.uninstall.shno longer reports success whendocker compose downfails. Re-running setup no longer nestslib/lib.
Local checks: Ghost admin, a published post that survived a container restart, static export with validation, shellcheck, and the repo test scripts. CI validate and compose-smoke passed on 5ecdeb6. deploy.sh git push and actions/deploy-pages were not run against a live Pages site. Merging this repository does not publish a blog.
Issue #28 matches the change and is still open. It is not formally linked on this PR.
The changelog and the version printed by install.sh need to match the release tag.


Summary
~/.ghost, without replacing the Ghost-CLIinstall.shpath.deploy.sh/gssgon the host; Compose is an alternative for Windows/WSL.Test plan
scripts/compose-smoke.shagainst a local Compose stackdeploy.shwouldCloses #28