Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Adds a GitHub Actions workflow for building Jekyll sites with PR preview support.

Changes

  • Build job: Uses actions/jekyll-build-pages@v1 to build the Jekyll site (no Gemfile required)
  • PR preview: Uses CDCgov/cfa-actions/post-artifact@main to post artifact download link as PR comment
  • PR-only: Triggers on all PRs targeting main branch (deployment handled by existing GitHub Pages setup)

This workflow provides a way to preview Jekyll site changes before merging, without interfering with the existing GitHub Pages deployment configuration.

Original prompt

I would like to have a workflow that builds the jekyll site and provides a preview for PRs. Can you do that for me?


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 29, 2026 19:10
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Copilot AI changed the title [WIP] Add workflow to build Jekyll site and provide PR preview Add Jekyll site build and PR preview workflow Jan 29, 2026
Copilot AI requested a review from gvegayon January 29, 2026 19:13
Copy link
Member

@gvegayon gvegayon left a comment

Choose a reason for hiding this comment

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

@copilot, address my comments. Plus, there is an issue in the workflow: It tried running and got an error:

Run bundle exec jekyll build --destination _site
Could not locate Gemfile or .bundle/ directory
Error: Process completed with exit code 10.

Comment on lines 7 to 18
paths:
- '_config.yml'
- '_layouts/**'
- '_includes/**'
- '_posts/**'
- '_data/**'
- 'assets/**'
- '*.md'
- '*.html'
- 'Gemfile'
- 'Gemfile.lock'
- '.github/workflows/jekyll.yml'
Copy link
Member

Choose a reason for hiding this comment

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

I think we can skip this. The site is fairly simple so it shouldn't be an issue building it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in 227aa83. The workflow now triggers on all PRs targeting main without path filters.

Comment on lines 23 to 33
- '_config.yml'
- '_layouts/**'
- '_includes/**'
- '_posts/**'
- '_data/**'
- 'assets/**'
- '*.md'
- '*.html'
- 'Gemfile'
- 'Gemfile.lock'
- '.github/workflows/jekyll.yml'
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Comment on lines 66 to 75
- name: Upload artifact for GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./_site

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: jekyll-site
path: ./_site
Copy link
Member

Choose a reason for hiding this comment

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

So, the repo is already set up to use GitHub pages via jekyll. Will this interfere with the current set up? Perhaps, we don't want to upload the pages artifact, but only run this when running a PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 227aa83. Removed the pages artifact upload - now only uploads a regular artifact for PR preview. The deploy job was also removed so this workflow won't interfere with the existing GitHub Pages setup.

Comment on lines 89 to 100
# Deploy to GitHub Pages (only on main branch)
deploy:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, so maybe not deploy in this workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in 227aa83. The deploy job has been removed - this workflow now only runs on PRs for preview purposes.

…ilder

Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot, address my comments. Plus, there is an issue in the workflow: It tried running and got an error:

Fixed in 227aa83. The workflow now:

  • Uses actions/jekyll-build-pages@v1 instead of bundle exec jekyll (no Gemfile required)
  • Removed path filters as requested
  • Only runs on PRs (removed deploy job since the repo already uses GitHub Pages via Jekyll)

Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Copilot AI changed the title Add Jekyll site build and PR preview workflow Add Jekyll site PR preview workflow Jan 29, 2026
Copilot AI requested a review from gvegayon January 29, 2026 19:26
@gvegayon gvegayon marked this pull request as ready for review January 29, 2026 19:26
@gvegayon
Copy link
Member

This was done in the wrong repo!

@gvegayon gvegayon closed this Jan 29, 2026
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