Skip to content

feat: Host index.html Demo on GitHub Pages#37

Open
DebuggingMax wants to merge 1 commit intoAOSSIE-Org:mainfrom
DebuggingMax:feature/github-pages-demo
Open

feat: Host index.html Demo on GitHub Pages#37
DebuggingMax wants to merge 1 commit intoAOSSIE-Org:mainfrom
DebuggingMax:feature/github-pages-demo

Conversation

@DebuggingMax
Copy link

@DebuggingMax DebuggingMax commented Feb 26, 2026

Summary

This PR implements GitHub Pages hosting for the SocialShareButton demo as requested in #31.

Changes

  • ✅ Added .github/workflows/deploy-pages.yml - GitHub Actions workflow for automatic deployment
  • ✅ Updated README.md with live demo badge and link

How it works

  1. On every push to main branch, the workflow automatically deploys the site to GitHub Pages
  2. The demo will be accessible at: https://aossie-org.github.io/SocialShareButton/
  3. Users can view the live demo without cloning the repo

Setup Required (After Merge)

The repository maintainer needs to:

  1. Go to SettingsPages
  2. Under Build and deployment, select GitHub Actions as the source

Benefits

  • 🌐 Users can view a live demo without cloning the repo
  • 🧪 Quick testing of styles and configurations
  • 📝 Demo link directly accessible from README

Closes #31

Summary by CodeRabbit

  • New Features

    • Demo site now deployed to GitHub Pages with automated deployment workflow.
  • Documentation

    • README updated with a Live Demo badge/link and revised demo instructions and guidance.

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 007d407 and 07a4224.

📒 Files selected for processing (2)
  • .github/workflows/deploy-pages.yml
  • README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • README.md
  • .github/workflows/deploy-pages.yml

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow to build and deploy the repository root (demo index.html) to GitHub Pages on pushes to main and manual dispatch; updates README badges and demo links to point to the hosted Pages site.

Changes

Cohort / File(s) Summary
GitHub Actions Deployment Workflow
\.github/workflows/deploy-pages.yml
New workflow that runs on push to main and workflow_dispatch; grants contents: read, pages: write, id-token: write; steps: checkout, configure pages, upload artifact (.), and deploy to GitHub Pages with environment github-pages.
README Documentation
README.md
Updated demo/badge links: AOSSIE Social_Share_Button badge now points to the GitHub Pages demo URL and a Live Demo badge/link was added; demo instructions and local open note revised.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant GH as GitHub (repo)
  participant Runner as Actions Runner
  participant Pages as GitHub Pages

  Dev->>GH: push to main / manual dispatch
  GH->>Runner: trigger workflow (deploy-pages.yml)
  Runner->>GH: actions/checkout (get repo files)
  Runner->>Runner: actions/configure-pages (prepare deployment)
  Runner->>Runner: actions/upload-pages-artifact (package `.`)
  Runner->>Pages: actions/deploy-pages (publish artifact)
  Pages-->>GH: deployment created (pages URL output)
  GH-->>Dev: workflow completes (deployment URL)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A tiny hop on main and away,

the demo springs live for all to display.
Checkout, upload, deploy with a cheer—
Click the badge, and the demo appears! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding GitHub Pages hosting for the demo. It directly summarizes the primary objective of the changeset.
Linked Issues check ✅ Passed All coding requirements from issue #31 are met: GitHub Actions workflow added for deployment, demo hosted on GitHub Pages, and live demo link added to README.
Out of Scope Changes check ✅ Passed All changes directly support the feature objective of hosting the demo on GitHub Pages. No unrelated or out-of-scope modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
.github/workflows/pages.yml (2)

6-9: Optional: Add path filters to avoid unnecessary deployments.

Currently, any push to main triggers deployment, even for changes to files that don't affect the demo (e.g., CI workflows, documentation outside the demo). Consider adding path filters if you want to reduce unnecessary workflow runs.

💡 Optional: Add path filters
 on:
   # Runs on pushes targeting the default branch
   push:
     branches: ["main"]
+    paths:
+      - 'index.html'
+      - 'css/**'
+      - 'js/**'
+      - 'images/**'
+      # Add other demo-related paths as needed
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pages.yml around lines 6 - 9, The push trigger currently
uses only "on: push: branches: [\"main\"]" so every push to main runs the pages
workflow; narrow this by adding path filters to the push trigger (use "paths:"
to include only demo-related files or "paths-ignore:" to skip CI/docs) so
unrelated changes don't trigger deploys—update the workflow trigger block (the
on: push: branches: ["main"] section) to include an appropriate "paths" or
"paths-ignore" list that matches your demo/source files.

37-41: Consider uploading only the demo files instead of the entire repository.

Using path: '.' uploads the entire repository including source files, workflow files, and other non-demo content. This works but increases artifact size and exposes all repository files on the Pages site.

If only the demo files are needed, consider specifying a more targeted path or creating a dedicated docs/ or demo/ directory.

💡 Optional: Upload specific files only

If you want to limit what gets deployed, you could either:

  1. Move demo files to a dedicated directory and update the path:
        with:
-          # Upload entire repository
-          path: '.'
+          # Upload only demo directory
+          path: './demo'
  1. Or keep current setup if exposing the full repository is intentional for users to browse source files alongside the demo.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pages.yml around lines 37 - 41, The Upload artifact step
currently uses actions/upload-pages-artifact@v3 with path: '.' which uploads the
whole repo; change the step so it only uploads your demo/site files—either move
the demo to a dedicated directory (e.g., docs/ or demo/) and set the Upload
artifact step’s path to that directory, or update the step to target only the
specific demo build output (e.g., the static site output directory) instead of
'.' to reduce artifact size and avoid exposing unrelated repo files; the step to
edit is the job step named "Upload artifact" that uses
actions/upload-pages-artifact@v3.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/pages.yml:
- Around line 6-9: The push trigger currently uses only "on: push: branches:
[\"main\"]" so every push to main runs the pages workflow; narrow this by adding
path filters to the push trigger (use "paths:" to include only demo-related
files or "paths-ignore:" to skip CI/docs) so unrelated changes don't trigger
deploys—update the workflow trigger block (the on: push: branches: ["main"]
section) to include an appropriate "paths" or "paths-ignore" list that matches
your demo/source files.
- Around line 37-41: The Upload artifact step currently uses
actions/upload-pages-artifact@v3 with path: '.' which uploads the whole repo;
change the step so it only uploads your demo/site files—either move the demo to
a dedicated directory (e.g., docs/ or demo/) and set the Upload artifact step’s
path to that directory, or update the step to target only the specific demo
build output (e.g., the static site output directory) instead of '.' to reduce
artifact size and avoid exposing unrelated repo files; the step to edit is the
job step named "Upload artifact" that uses actions/upload-pages-artifact@v3.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d73852d and ed9005f.

📒 Files selected for processing (1)
  • .github/workflows/pages.yml

@DebuggingMax DebuggingMax force-pushed the feature/github-pages-demo branch from ed9005f to 007d407 Compare February 27, 2026 05:49
@DebuggingMax DebuggingMax changed the title feat: Add GitHub Pages deployment for index.html demo feat: Host index.html Demo on GitHub Pages Feb 27, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/deploy-pages.yml (1)

33-36: Scope the uploaded Pages artifact to demo assets only.

Line [36] currently uploads the full repo root. Prefer staging only the demo files to reduce accidental public surface and artifact bloat.

Proposed refactor
+      - name: Prepare Pages artifact
+        run: |
+          mkdir -p _site
+          cp index.html _site/
+          cp -R public _site/public
+
       - name: Upload artifact
         uses: actions/upload-pages-artifact@v3
         with:
-          path: '.'
+          path: './_site'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy-pages.yml around lines 33 - 36, The Upload artifact
step (name: "Upload artifact", uses: actions/upload-pages-artifact@v3) is
currently uploading the repo root (path: '.') — change the path input to only
the demo/site build output directory (e.g. 'demo', 'demo/dist' or the actual
demo build output) so only demo assets are staged; update the step's with.path
value to that specific folder and verify the demo build step produces files
there before upload.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/deploy-pages.yml:
- Around line 28-40: Replace the four mutable action refs (actions/checkout@v4,
actions/configure-pages@v5, actions/upload-pages-artifact@v3,
actions/deploy-pages@v4) with their corresponding immutable commit SHAs; locate
each `uses:` line in the workflow and update the ref after `@` to the exact
40-character commit SHA from the action's repository (e.g., the latest stable
commit for each action) so the workflow pins to specific commits rather than
version tags.

---

Nitpick comments:
In @.github/workflows/deploy-pages.yml:
- Around line 33-36: The Upload artifact step (name: "Upload artifact", uses:
actions/upload-pages-artifact@v3) is currently uploading the repo root (path:
'.') — change the path input to only the demo/site build output directory (e.g.
'demo', 'demo/dist' or the actual demo build output) so only demo assets are
staged; update the step's with.path value to that specific folder and verify the
demo build step produces files there before upload.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed9005f and 007d407.

📒 Files selected for processing (2)
  • .github/workflows/deploy-pages.yml
  • README.md

Comment on lines +28 to +40
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Pin GitHub Actions to commit SHAs for supply-chain hardening.

At Line [28], Line [31], Line [34], and Line [40], version tags are mutable. Prefer SHA pinning to prevent unexpected action drift.

Use this check to find non-SHA-pinned actions across workflows (expected: no output after remediation):

#!/bin/bash
set -euo pipefail

rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' '^\s*uses:\s*[^@]+@[^[:space:]]+' \
| awk -F'@' '
{
  ref=$2
  if (ref !~ /^[0-9a-fA-F]{40}$/) print $0
}'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy-pages.yml around lines 28 - 40, Replace the four
mutable action refs (actions/checkout@v4, actions/configure-pages@v5,
actions/upload-pages-artifact@v3, actions/deploy-pages@v4) with their
corresponding immutable commit SHAs; locate each `uses:` line in the workflow
and update the ref after `@` to the exact 40-character commit SHA from the
action's repository (e.g., the latest stable commit for each action) so the
workflow pins to specific commits rather than version tags.

- Add GitHub Actions workflow to deploy index.html to GitHub Pages
- Update README with live demo link badge
- Users can now preview the SocialShareButton without cloning the repo

Fixes AOSSIE-Org#31
@DebuggingMax DebuggingMax force-pushed the feature/github-pages-demo branch from 007d407 to 07a4224 Compare February 28, 2026 19:39
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.

[FEATURE]: Host index.html Demo on GitHub Pages

1 participant