Skip to content

Add output_dir parameter to upload method#26

Open
baelter wants to merge 2 commits into
mainfrom
feat/upload-accepts-output-dir
Open

Add output_dir parameter to upload method#26
baelter wants to merge 2 commits into
mainfrom
feat/upload-accepts-output-dir

Conversation

@baelter

@baelter baelter commented Mar 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Add optional output_dir keyword argument to upload method
  • When provided, skips the internal render call and uses the given directory
  • Fully backward-compatible: existing callers are unaffected

This enables the cloudamqp-website deploy script to render once, run pagefind on the output, then upload directly, cutting CI build time in half (~5.5 min to ~3 min).

Test plan

  • Verify existing callers (without output_dir) still work (render is called as before)
  • Verify new callers passing output_dir skip the render step

Allow callers to pass a pre-rendered output directory to skip
the render step. This enables workflows like pagefind indexing
that need to render once, modify the output, then upload without
a redundant second render.
@baelter baelter marked this pull request as ready for review March 25, 2026 12:40
@baelter baelter requested a review from a team as a code owner March 25, 2026 12:40
@baelter baelter requested a review from dentarg March 25, 2026 12:40
@baelter baelter requested a review from Copilot June 8, 2026 19:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends Website::Deployer#upload with an optional output_dir: keyword argument so callers can reuse a pre-rendered site directory (skipping the internal render step), enabling faster CI pipelines that do additional processing (e.g., pagefind) before uploading.

Changes:

  • Add output_dir: keyword argument to upload.
  • Skip render when output_dir is provided by the caller.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/website/deployer.rb Outdated
Comment on lines +75 to +76
def upload(domain, force_deploy: false, output_dir: nil)
output_dir ||= render
Addresses review feedback: validate a caller-provided output_dir up front
with a clear ArgumentError instead of a low-level Errno::ENOENT from
Dir.chdir, and replace the misleading "Render failed!" message with one
that names the directory missing index.html (render may have been skipped).
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.

3 participants