-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implement GitHub Pages plugin #409
Conversation
364a0d5
to
adf7bb0
Compare
adf7bb0
to
f640733
Compare
This is ready for review. A few changes that I made that I don't feel super strongly about, but would like your thoughts on @soenkehahn:
.add(deployGhPages(self => self.myPkg))
// and in the future:
.add(deployGhPages(self => self.myPkg, { pushTo: 'origin' })) rather than .add(deployGhPages(self => ({ package: self.myPkg })))
// in the future:
.add(deployGhPages(self => ({ package: self.myPkg, pushTo: 'origin' }))) especially since I can't imagine any use case for any options needing something off of the |
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 tried this out on a project here: https://github.com/soenkehahn/garn-example-vite-vanilla (This is using a branch of garn with both the gh-pages plugin and the vite-builder plugin.)
When doing garn run viteVanilla.deployToGhPages
in there, it creates a commit on gh-pages
, but I get this output:
[...]
Created commit to "gh-pages" branch, but it has not been pushed yet
Run git push <remote> gh-pages:gh-pages to deploy
rm: cannot remove '/tmp/tmp.Mn58cn7bio/dst/assets/index-QFzqfbCu.js': Permission denied
rm: cannot remove '/tmp/tmp.Mn58cn7bio/dst/assets/index-s-MxoWxy.css': Permission denied
I'm assuming the error messages at the end are caused by copying something from the nix store to a temporary directory, which then will be read-only. And then trying to delete the temporary directory afterwards.
Also, when pushing to the gh-pages branch, github serves the files, however the app doesn't work because of mime-type issues. :( Maybe this is something that has to be fixed in the vite-builder plugin?
ts/deployToGhPages.ts
Outdated
const ansiRedBold = "\\e[31;1m"; | ||
|
||
/** | ||
* A garn plugin that allows easy deployment of a package to GitHub pages. |
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.
Maybe link to github pages documentation here?
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 added a link to https://pages.github.com/. Let me know if you think something like https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site would be better
Never mind. To deploy vite apps to github pages, you have to configure the |
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.
Looks good, apart from my comments.
Co-authored-by: Sönke Hahn <[email protected]>
Yeah, our test package didn't output any nested directories. I updated the tests in c32d5a4 to create a nested dir to catch this in the future.
One thing to note is that this only applies to project pages, not user/organization pages. |
No description provided.