-
Notifications
You must be signed in to change notification settings - Fork 0
Add Jekyll site PR preview workflow #64
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
Conversation
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
gvegayon
left a comment
There was a problem hiding this 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.
.github/workflows/jekyll.yml
Outdated
| paths: | ||
| - '_config.yml' | ||
| - '_layouts/**' | ||
| - '_includes/**' | ||
| - '_posts/**' | ||
| - '_data/**' | ||
| - 'assets/**' | ||
| - '*.md' | ||
| - '*.html' | ||
| - 'Gemfile' | ||
| - 'Gemfile.lock' | ||
| - '.github/workflows/jekyll.yml' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
.github/workflows/jekyll.yml
Outdated
| - '_config.yml' | ||
| - '_layouts/**' | ||
| - '_includes/**' | ||
| - '_posts/**' | ||
| - '_data/**' | ||
| - 'assets/**' | ||
| - '*.md' | ||
| - '*.html' | ||
| - 'Gemfile' | ||
| - 'Gemfile.lock' | ||
| - '.github/workflows/jekyll.yml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
.github/workflows/jekyll.yml
Outdated
| - 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
.github/workflows/jekyll.yml
Outdated
| # 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
Fixed in 227aa83. The workflow now:
|
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
|
This was done in the wrong repo! |
Adds a GitHub Actions workflow for building Jekyll sites with PR preview support.
Changes
actions/jekyll-build-pages@v1to build the Jekyll site (no Gemfile required)CDCgov/cfa-actions/post-artifact@mainto post artifact download link as PR commentThis workflow provides a way to preview Jekyll site changes before merging, without interfering with the existing GitHub Pages deployment configuration.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.