Skip to content

Static preview support #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2025
Merged

Static preview support #80

merged 4 commits into from
Jul 1, 2025

Conversation

eljog
Copy link
Member

@eljog eljog commented Jun 25, 2025

For: https://github.com/github/spark/issues/741

Merge after: https://github.com/github/workbench-sdk/pull/403

Support static preview of the app, by keeping a build for the latest commit running on the default vite preview port

@Copilot Copilot AI review requested due to automatic review settings June 25, 2025 23:49
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for running a static preview of the app by installing a separate supervisor program and automating builds on commit and container start.

  • Introduce a new Supervisor program (spark-static-preview) to serve the latest build via npm run preview.
  • Add a post-commit script and hook to rebuild the app automatically into preview-build.
  • Wire up post-commit execution in both postStartCommand.sh and onCreate.sh.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
.devcontainer/spark.conf Added a Supervisor program for static preview hosting
.devcontainer/postStartCommand.sh Execute the post-commit script once on container start
.devcontainer/post-commit New build script that outputs to the preview directory
.devcontainer/onCreate.sh Set up Git hook and run initial build for static preview support
Comments suppressed due to low confidence (2)

.devcontainer/onCreate.sh:34

  • Ensure .devcontainer/post-commit is executable before creating the hook. For example, run chmod +x .devcontainer/post-commit to avoid permission issues.
ln -fs $(pwd)/.devcontainer/post-commit .git/hooks/post-commit

@eljog eljog merged commit ddba28c into main Jul 1, 2025
3 checks passed
@eljog eljog deleted the eljog/static-preview-support branch July 1, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants