feat: Add GitHub Pages deployment workflow for /site folder#6
Merged
JoshuaAFerguson merged 1 commit intoNov 14, 2025
Conversation
Implements GitHub Actions workflow to automatically deploy /site folder to gh-pages branch. This allows GitHub Pages to serve the website from a subfolder without requiring repository restructuring. - Triggers on pushes to main branch that modify /site or the workflow - Uses peaceiris/actions-gh-pages action for deployment - Publishes /site contents to root of gh-pages branch - Supports manual workflow dispatch
JoshuaAFerguson
pushed a commit
that referenced
this pull request
Nov 15, 2025
Implements Task #6 from IMPLEMENTATION_ROADMAP.md - complete template version control with snapshot/restore functionality similar to git. Changes to api/internal/db/database.go: Database Schema (user_session_template_versions table): - Add user_session_template_versions table for version control - Serial ID primary key with auto-incrementing version numbers - template_id references user_session_templates - version_number (INT, unique per template) - template_data (JSONB, full snapshot of template configuration) - description (TEXT, version notes/changelog) - created_by (user who created version) - tags (TEXT[], optional version tags like "stable", "v1.0") - UNIQUE constraint on (template_id, version_number) - 3 indexes for query optimization (template_id, created_by, created_at) Changes to api/internal/handlers/sessiontemplates.go: Template Versioning (Task #6): - Replace placeholder ListTemplateVersions with real pagination - Implement CreateTemplateVersion with template snapshot - Implement RestoreTemplateVersion with auto-backup safety - Add permission helpers: canAccessTemplate, canModifyTemplate - Add internal createVersionSnapshot for auto-backups - Add PostgreSQL array helpers for tags ListTemplateVersions Implementation: - Permission check via canAccessTemplate (owner or shared) - Pagination support (query params: page, limit) - Defaults: page=1, limit=50, max=100 - Returns versions ordered by version_number DESC (newest first) - Includes total count for pagination UI - Parses PostgreSQL TEXT[] arrays for tags - Comprehensive JSON unmarshaling for template_data JSONB CreateTemplateVersion Implementation: - Permission check via canModifyTemplate (owner or write/manage) - Snapshots current template using row_to_json() - Auto-increments version using MAX(version_number) + 1 - Stores full template configuration as JSONB - Supports optional description and tags - Converts tags to PostgreSQL array format - Returns new version ID and version number - Logs version creation for audit trail RestoreTemplateVersion Implementation: - Permission check via canModifyTemplate - Retrieves specified version from database - **Safety mechanism**: Creates auto-backup before restoring - Updates all template fields with versioned data - Gracefully continues if backup fails (logs warning) - Comprehensive audit logging for restore operations - Updates timestamp on template modification Permission Helpers: - canAccessTemplate: Checks ownership or any share access (read) - canModifyTemplate: Checks ownership or write/manage permission - Both integrate with template_shares for permission inheritance Internal Helpers: - createVersionSnapshot: Creates version snapshot (used for backups) - splitPostgresArray: Parses PostgreSQL TEXT[] to Go []string - joinPostgresArray: Converts Go []string to PostgreSQL array format - splitByComma: Handles comma-separated values with quote handling Technical Details: - Added strings import for string manipulation - TemplateVersion struct for response serialization - row_to_json() for efficient template snapshotting - COALESCE(MAX(version_number), 0) + 1 for auto-increment - PostgreSQL array format: {"tag1","tag2","tag3"} - Auto-backup tagged with "auto-backup" for identification Security Features: - User ownership verification for all operations - Permission-based access control (read vs. write/manage) - Template share integration - SQL injection protection with parameterized queries - Auto-backup before restore protects against data loss IMPLEMENTATION_ROADMAP.md Updates: - Mark Task #6 (Template Versioning) as COMPLETED - Update progress: 67% (6/9 tasks) - P2 Medium Priority now 100% complete (3/3) - Document all three operations with implementation details - Include database schema, permission system, helper functions Impact: - Template versioning now production-ready with git-like version control - Users can create snapshots of templates at any time - Users can restore templates to previous versions safely - Auto-backup prevents accidental data loss during restore - Full audit trail with version history - Complete ALL P2 Medium Priority tasks (3/3 completed)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements GitHub Actions workflow to automatically deploy the
/sitefolder to GitHub Pages using thegh-pagesbranch approach.Changes:
.github/workflows/github-pages.ymlworkflow/sitecontents togh-pagesbranch on push tomainWhy this approach:
/docs, or branches - not arbitrary subfolders like/site/docsfor technical docs,/sitefor website)Configuration Required After Merge
gh-pagesand folder:/ (root)Test Plan
https://joshuaaferguson.github.io/streamspace/Related
Resolves the issue where GitHub Pages cannot serve from the
/sitesubfolder directly.