How do I have a live site and a dev site in a single repo #23962
-
Hi there to all of you GitHub experts, I am currently developing a pet project of my (a public website.) The idea is basically to see what happens if total strangers from across the globe collaborate to create a website on a particular theme - my theme is gaming. My hope is that together we can create something wonderful - each helping the other with languages/technologies that we are more familar with - but due to the open nature of my project, I need a versioning and colaboration system that is universal and doesn’t rely on paid software or services. Welcome git and GitHub! Both are perfect for such a project as git is free and open source and cross plaform and GitHub provides free accounts, so even those who don’t want or cant afford to pay can still take part. The one expense for the project is a dedicated server - which I pay for anyway, so creating a webspace on my server and asigning a domain to it is no biggie to me and since it is my project, I am willing to aborb that cost. So having explained what I intend on doing, now to the explaining of what I want to do - which brings me to my question. Currently I have the following setup
This is working fine, everything goes as you would expect except for one thing - I now have two identicle websites. One hosted on my server and one hosted on GitHub using GH-Pages. This is not quite the set up I want! What I want is a setup like this
I also what this as well (on the same repo)
So basically: I will have a live website hosted on my server, the server will pull source files from the remotes master branch and deploy them to the httpdocs foder and I will also have a dev version of that same website hosted on GH-Pages that uses a dev branch/folder as its source. That would mean:
I have been trying to figure out how to set this up to no avail. Can any of you point me in the direction of some help articles or give me any instructions on how I can create the set up detailed above: A dev site and a live production site, both from the same repo? Cheers jay |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information. As you’ll notice, your Topic is now in the Pages board. No action is needed on your part; you can continue the conversation as normal here. |
Beta Was this translation helpful? Give feedback.
-
Cheers @lee-dohm I should have realised that it was more a GH-Pages question. |
Beta Was this translation helpful? Give feedback.
-
You’re welcome. We’ll figure these things out together 😀 |
Beta Was this translation helpful? Give feedback.
-
Just a reply to my original question to say that I have actually worked out how to do this on my own by using the gh-pages branch. Currently this is my setup now: dev This is my current working branch. Other branches like comingsoon may be checkout from this branch, allowing me to work on small portions of problematic code or test new layouts, without effecting the rest of the content housed here. Those branches are then merged back into the dev branch once issues have been closed. gh-pages This is now my testing branch. gh-pages displays the very latest beta build of the site. pages/links/content might be broken and not display properly. This is where the public can test out the latest and greatest and submit issues/bug reports if they find them. master This is the defacto source for content that has been through dev and beta testing. This branch is automatically deployed to my server everytime something is pushed to it So now I have a continuous working branch _ dev and a beta testing branch to showcase and test my latest builds gh-pages _ and lastly a defacto branch _ master _ that is always up-to-date with my server. Hopefully I have sorted this out now and my setup will work. It seems to have been up till now though. |
Beta Was this translation helpful? Give feedback.
-
How would you go to your dev site; what is the URL formation method? https://username.github.io/dev/ If you use the github pages master for the front page of a website, how would you see the dev build at a different URL? Thanks ~ |
Beta Was this translation helpful? Give feedback.
-
Reiterating kevineverywhere’s question: What URL do you use to test the “dev” page (without affecting the production version)? |
Beta Was this translation helpful? Give feedback.
Just a reply to my original question to say that I have actually worked out how to do this on my own by using the gh-pages branch.
Currently this is my setup now:
dev
This is my current working branch. Other branches like comingsoon may be checkout from this branch, allowing me to work on small portions of problematic code or test new layouts, without effecting the rest of the content housed here. Those branches are then merged back into the dev branch once issues have been closed.
gh-pages
This is now my testing branch. gh-pages displays the very latest beta build of the site. pages/links/content might be broken and not display properly. This is where the public can test out the lat…