-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Add deploy-gh-pages command which builds site and publishes to Github Pages #6
Comments
Algorithm is:
Orphan branches have their own history. Using a cloned git repo avoids having to switch to the |
Need to auto-prefix links with name of repo. Need way to disable this in config so people pointing a domain at github site can disable this. |
Or probably the simplest way to do this is to put the prefix value in the config. Check if the config key is there, if not, ask for it. |
Found these (limited to Node) https://github.com/koistya/git-push |
Oh nice finds! Yeah, the node-romulus script looks almost perfect. We could copy that pretty easily and tweak it to our needs. |
Also:
It also accept a repo url so it could push to any git based provider (i.e. Azure, Heroku, GitHub Pages as git-push). |
@KyleAMathews Hey! Really nice work on this project so far, I am looking forward to giving it a more thorough try. Would you be interested in a pull request that adds Surge as the deployment tool? Surge can be installed as a npm install --save-dev surge
surge ./public my-gatsby-blog.surge.sh This is what React projects Spectacle and hjs-webpack do. You can also use custom domains for free, and catch-all URLs for client-side routing with React. Let me know what you think! Either way, excited to see more React + static stuff out there. |
@kennethormandy hey adding support for Surge would be great! I'm actually speccing out a plugin system for Gatsby right now. Surge would be a great "publish" plugin. There could be a number of these like publishing to Surge, Amazon S3, Github, etc. So to publish to Surge, the cli command would be something like Could you create a quick issue about supporting Surge and other publish plugins to keep track of this? |
+1 for this. Also was interested if there's any docs on how to use gatsby for github pages. I used the documentation starter and am about to try this out. Any hint into the right direction would be helpful. |
This issue is about automating publishing to github pages. It's pretty easy to do manually in the meantime. Steps are:
|
perfect, thanks! |
I just tried this and the steps do not work, as the starter template generates absolute link paths. See http://matteodem.github.io/meteor-easy-search/, branch is https://github.com/matteodem/meteor-easy-search/tree/gh-pages |
@matteodem I’m hoping I’m able to work on a built-in deployment integration using Surge per #52, but if you want to try that as an alternative in the meantime: npm install -g surge
surge ./path/to/gatsby-build This will prompt you to create an account and publish for free. You could also save Surge as a |
oh, that looks great thanks! I'll have a look this weekend. |
Yeah... it's a bit hacky right now getting URLs to work. I think the right solution is to have a |
And surge is definitely the easy solution for now :) |
LOL, actually my former self agrees with my current self. I already added that link function gatsby/lib/isomorphic/gatsby-helpers.js Lines 6 to 14 in 852ae4b
|
@matteodem the 0.7 release I did earlier improved the support for gh-pages a ton. You should be able to create a new docs or blog site and push it to github pages and it'll work. See the release notes https://github.com/gatsbyjs/gatsby/releases/tag/v0.7.0 |
Somehow I missed this npm package when looking around before https://www.npmjs.com/package/gh-pages. Just tested the global version and it works beautifully. I'm thinking now we'll just add deploy support for as targets as people want to support. For starters github pages and surge. The commands will be something like One thought is to add deployment as a option for building e.g. /cc @kennethormandy |
thanks for the update will try it out in the next days! |
@KyleAMathews Since I last updated you on this, we made it possible to build Surge into a CLI easily. Here are the docs right now for using Surge and Commander together. I think you would still want the build command separate. With Surge, you can run the build step automatically as part of the deployment, and then show an error if necessary if the compilation fails for some reason, and otherwise finish the deploy. We have a more thorough Commander example doing exactly that which I can pass along as well. |
👍 thanks for the link @kennethormandy, the integration looks like it'll be very easy. |
I'm going to say deploy plugins are out of scope. It's easy enough to install |
Just for reference, I found this useful gist |
Is there any tutorial that provides more info about this? Or maybe it could be added to the documentation? |
Oh, looks like that this is already part of the default boilerplate as |
👍😉👊
|
Actually this isn't quite usable in its current state because it removes the I'll submit a PR to fix this once gh-pages itself is fixed: |
Perhaps just copy the CNAME file into public using the postBuild hook? |
Hmm, would that work? If I understand things correctly, the |
As I understand, gh-pages just copies directly over from the src directory.
|
Oh of course! Since the CNAME has to end up at the root of the |
I just ran into this problem and tried to sum it up. Let me know if this kinda sorta covers the bases? http://andrewdc.com/ghpages-gatsby-and-domains/ Thanks all for the solutions above!! |
@andrewdc looks great! Thanks for writing up your solution! |
Add history as top-level dependency
Add simple 404 page
UPDATE: We'll be using https://www.npmjs.com/package/gh-pages
The text was updated successfully, but these errors were encountered: