Skip to content

Added the ability to deploy to github pages.#16

Open
dlabaj wants to merge 1 commit intomainfrom
hosting
Open

Added the ability to deploy to github pages.#16
dlabaj wants to merge 1 commit intomainfrom
hosting

Conversation

@dlabaj
Copy link
Contributor

@dlabaj dlabaj commented Feb 26, 2026

Added the ability to deploy to github pages. Close issue #8

@dlabaj dlabaj requested a review from jpuzz0 February 26, 2026 03:23
@dlabaj dlabaj self-assigned this Feb 26, 2026

console.log(`🚀 Deploying "${distDir}" to GitHub Pages (branch: ${branch})...`);
await execa('npx', ['gh-pages', '-d', distDir, '-b', branch], {
cwd,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since gh-pages isn't in package.json, this downloads it fresh every time via npx. Should it be a direct dependency instead?

throw new Error(
`Build output directory "${distDir}" does not exist. Run a build first or specify the correct directory with -d/--dist-dir.`
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If someone passes an absolute path for --dist-dir, would path.join here do the right thing? path.resolve might be safer.

throw new Error(
'This directory is not a git repository. Initialize with "git init" or use "patternfly-cli init", and ensure the repo has a remote (e.g. GitHub) before deploying.'
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

save.ts checks for an origin remote before pushing — should this do the same? Without it, gh-pages will fail with a pretty cryptic git error.

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