-
-
Notifications
You must be signed in to change notification settings - Fork 360
Automatically build book and deploy to a repo #284
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
Conversation
Not a bad idea. If there is one thing we should automate then it's probably testing whether a PR breaks the build or not. Automatic deployment is something we will have to talk about first, but I'm definitely in favor of it. I read the scripts and couldn't find anything really wrong with them. Your shell scripts are definitely better than mine. I don't know any Travis specifics, though. PS: I want to mention how much I appreciate the quality PR. It has screenshots and everything! I hope you'll stick around for a while. :) |
Yup. This is a geed feature. Thanks! I don't know if I am qualified to review it though. |
Thanks. There is another CI provider, CircleCI, that may or may not be better. If you leave this open for a little while, it'll give me a chance to try it out. |
I agree, if the code gets verified by someone of our team and it is alright, I don't see any problems with this PR. |
I'm fine with sticking to Travis. I think it's relatively standard. If it works, it works. |
Hey @berquist , A few quick questions from someone who is completely new to this:
I think I got things set up on my end, so if no one is against the idea, I might merge the PR soon and see if it works. |
|
Since there doesn't seem to be further discussion here and this is a good change, I will go ahead and merge it. |
Hey, I screwed up. I didn't know this would push to algorithm-archivists.github.io. I thought it would only merge to the algorithm-archive. We reverted the changes because the site went down, but I am not entirely sure why that happened I definitely want CI in this repo. It makes a lot of sense. How do we go about debugging this and figuring out what went wrong? |
So we basically only want 1 and not 2. |
I should have said "this will deploy to algorithm-archivists.github.io" and not been vague. So, I will back out part 2. However, I only partially understand why it didn't work. Part of it is that I didn't handle the I don't know if the missing |
@berquist We're currently discussing the topic, so we might go with the full scope of the PR. It can also be, that Leios configured Travis CI wrong, which might have caused errors, but I'm unsure about that. |
So after some discussion, I think we have agreed the automatic deployment is worth it. I just for some reason completely misunderstood. Looking at it, it's clear. I think the reason this didn't work is because I didn't provide my PAT for the algorithm-archivists.github.io repo, but instead for the algorithm-archive, only. Do you think it would work if I gave the pat to the algorithm-archivists.github.io instead? |
No, I looked at the Travis log and it worked. There is a problem with my understanding of what extra bits were in the site repo. Even cloning the book repo would have failed without the PAT. I should say that once you generate the PAT, it gives Travis access to do anything you can do as a GitHub user, up to the limit of those checkboxes when you were generating it. You have push access to |
I have push access, but the master branch is protected. Does that matter? |
yes when it does force push |
So this probably would have worked if the branch was not protected? |
Rather than me guess, I will try it out...give me a few minutes. |
No rush, take your time. We know what we want now. It's now just a matter of figuring out what went wrong and fixing it. Sorry for making this super frustrating. |
maybe worth looking at https://docs.travis-ci.com/user/deployment/pages/#setting-the-github-token ? |
That's very interesting. I didn't know that existed. If a non-force-push with the custom script doesn't work, it could be rewritten using that...or maybe it should anyway. |
If you turn on Travis continuous integration (free), you can test code in a remote container and do other neat stuff, like deploy documentation...or a book.
1 can exist without 2, so if you don't like it, that part can be removed. The results for my build are at https://travis-ci.com/berquist/algorithm-archive. Signing up for Travis CI is relatively easy, but if you want point 2, here is the extra work required. Everything below here is about automatically deploying the book.
On GitHub, request a Personal Access Token, with
repo
scope. Instructions here, but can be done entirely from the browser. Keep the token somewhere safe, because you can't look at it again, and do not give it to anyone else.The deploy script requires that some environment variables be entered into Travis. At your Travis repo page,


click "More options" then "Settings", then scroll down. These are mine for testing. The repo is https://github.com/berquist/algorithm_archive_build/commits/master and the website is https://berquist.github.io/algorithm_archive_build/.
Your non-secret environment variables would be
GH_USER
:algorithm-archivists
GH_REPO_NAME
:algorithm-archivists.github.io
DOCS_BRANCH_NAME
:master
GH_TOKEN
: copy-paste the PAT here, and don't display it.