Skip to content

Conversation

@yibeichan
Copy link
Collaborator

Summary

This PR adds automatic GitHub Pages deployment functionality to the reproschema-protocol-cookiecutter template. Generated protocols can now be easily deployed as interactive web applications using reproschema-ui.

Features Added

1. GitHub Actions Workflow

  • New workflow file: .github/workflows/deploy-gh-pages.yml
  • Automatic deployment on:
    • Push to main branch
    • Version tags (v*)
    • Manual trigger with specific ref (branch/tag/commit)
  • Builds and configures reproschema-ui to serve the protocol
  • Shows deployed version in the banner for transparency

2. Documentation Updates

  • Comprehensive deployment instructions in README
  • Step-by-step guide for enabling GitHub Pages
  • Instructions for both automatic and manual deployment
  • Fixed URL generation using slugified protocol names

Technical Details

  • Uses Jinja2 {% raw %} tags to properly escape GitHub Actions expressions
  • Minimal permissions for security (contents: read, pages: write, id-token: write)
  • Concurrency control to prevent deployment conflicts
  • Supports deployment of specific versions/commits for testing

Testing

  • YAML syntax validated
  • Cookiecutter template generation tested
  • Variable substitution verified
  • Security best practices reviewed by QA agent
  • URL encoding issue fixed with slugify filter

Related Issues

This PR builds on top of #10 (which has been merged) and provides the deployment capability requested in the original discussion.

Next Steps

Users can now:

  1. Generate a protocol using the cookiecutter
  2. Push to GitHub
  3. Enable GitHub Pages (Settings → Pages → Source: GitHub Actions)
  4. Protocol automatically deploys to https://<org>.github.io/<protocol-name>

- Add GitHub Actions workflow to deploy protocol to GitHub Pages
- Support automatic deployment on push to main branch or version tags
- Enable manual deployment with specific branch/tag/commit
- Integrate with reproschema-ui for web-based protocol display
- Update README with comprehensive deployment instructions
- Use slugified protocol name for valid GitHub Pages URLs

The workflow builds reproschema-ui and configures it to serve the
protocol, with the deployed version shown in the banner for clarity.
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @yibeichan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement by adding an automated GitHub Pages deployment workflow to the reproschema-protocol-cookiecutter template. This enables projects generated from the template to be easily deployed as interactive web applications using reproschema-ui, streamlining the process of sharing and interacting with protocols.

Highlights

  • Automated GitHub Pages Deployment: A new GitHub Actions workflow (.github/workflows/deploy-gh-pages.yml) has been added to automatically build and deploy reproschema-ui with the generated protocol to GitHub Pages, enabling interactive web application deployment.
  • Flexible Deployment Triggers: The deployment workflow is configured to trigger automatically on pushes to the main branch and on the creation of version tags (e.g., v1.0.0). It also supports manual workflow_dispatch events, allowing users to deploy specific branches, tags, or commits.
  • Dynamic reproschema-ui Configuration: The workflow dynamically clones, builds, and configures reproschema-ui by copying the generated protocol files into its distribution and generating a custom config.js file. This configuration includes the protocol's source, contact information, and a banner indicating the deployed version.
  • Comprehensive Documentation Updates: The README.md has been updated with a new section providing clear, step-by-step instructions on how to enable GitHub Pages for the generated repository, how deployments are triggered, and how to access the deployed protocol.
  • Improved URL Handling: The deployment configuration and README.md now correctly utilize a slugify filter for the protocol name in URLs, ensuring valid and clean GitHub Pages paths.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a GitHub Actions workflow to automatically build and deploy protocols to GitHub Pages. The changes also include updated documentation in the README.

The review focuses on improving the robustness and correctness of the new workflow. Key suggestions include:

  • Pinning the reproschema-ui dependency to a specific version to ensure build stability.
  • Using slugify for the protocol name in generated URLs to handle names with spaces correctly.
  • Adjusting the concurrency settings to align with best practices for GitHub Pages deployments.
  • Using npm ci for faster and more reliable dependency installation.

- Pin reproschema-ui to commit 9f7b6b961cdcb516531bbbf1bf1b74648089d04a
- Ensures reproducible builds and prevents unexpected failures
- Addresses security concern raised in PR review
- Apply slugify filter to protocol_name in githubSrc and banner URLs
- Ensures valid URLs when protocol names contain spaces or special characters
- Consistent with README.md URL handling
- Change cancel-in-progress from false to true in concurrency settings
- Ensures only the latest commit is deployed by cancelling older deployments
- Follows GitHub Pages deployment best practices
- Saves runner minutes and avoids deploying outdated code
- Replace npm install with npm ci in the build step
- Provides faster, more reliable builds using package-lock.json
- Ensures exact dependency versions are used consistently
- Follows CI/CD best practices for reproducible builds
@yibeichan yibeichan merged commit be4a935 into main Jul 30, 2025
@yibeichan yibeichan deleted the feat/github-pages-deployment branch July 30, 2025 15:14
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