coala / coala-html

Interactive website generator using results from coala
GNU Affero General Public License v3.0
17 stars 40 forks source link

CI: Add automatic Github Pages deployment #143

Closed nalinbhardwaj closed 6 years ago

nalinbhardwaj commented 6 years ago

Automates Github Pages deployment by making travis commit any changes to master to gh-pages branch, and other branch changes to gh-pages-branch/"original branch name"

Currently, you can see it works on my fork. For example, commits to master automatically get pushed to gh-pages and deployed on my website http://nibnalin.me/coala-html/#/ . Branch CI-testing gets built and pushed to gh-pages-branch/CI-testing. Note that the original issue mentions using gh-pages/<branch name> but that couldn't be done since git would error out due to existence of gh-pages branch.

data folder used for building the website has to of course now be moved to master(I've done that), and the failing tests are unrelated to my PR, and have already been verified to fail on clean master by @Mixih

TODO: I would require an owner to provide a deploy key.

Closes https://github.com/coala/coala-html/issues/133

For short term contributors: we understand that getting your commits well defined like we require is a hard task and takes some learning. If you look to help without wanting to contribute long term there's no need for you to learn this. Just drop us a message and we'll take care of brushing up your stuff for merge!

Checklist

After you submit your pull request, DO NOT click the 'Update Branch' button. When asked for a rebase, consult coala.io/rebase instead.

Please consider helping us by reviewing other peoples pull requests as well:

The more you review, the more your score will grow at coala.io and we will review your PRs faster!

yukiisbored commented 6 years ago

deack https://github.com/coala/coala-html/pull/143/commits/454fe033c4fc61d27d1c5b7954c95310a62300a9

nalinbhardwaj commented 6 years ago

@yukiisbored Can you elaborate on the 2nd point? Most of the diff comes from putting the ‘data’ folder from gh-pages branch in master. I’ve only modified 2 files, .travis.yml and .ci/deploy.sh . The reason behind putting data here is to allow easy change of data to use to build gh-pages, otherwise you would earlier have to rebuild it manually on changing data. Regarding 1, I’ll check that out but currently coala/community seems to have a similar deployment system. Should that be changed as well? Also, I think I read online that the way I(and community repo) do it is more secure/modular?

yukiisbored commented 6 years ago

@nalinbhardwaj About coala/community, no idea, @jayvdb probably didn't know about Travis CI GitHub Pages deployment feature. Anyway about the Data folder, didn't notice those are coala json output since I reviewed from my phone. But, can you confirm deployment go smoothly since it looks like the data folder isn't inside the public/ folder which won't be part of the deployed site.

nalinbhardwaj commented 6 years ago

Yep @yukiisbored deployment is currently smooth and fine with data where it is. If you want however I can move it to some other directory?

Also there’s a problem with the Travis Github pages building, since it’s a yaml file, I don’t think we can do stuff like pushing to custom branch(as I require for this issue) like master pushes to gh-pages but any other branch “xyz” pushes to gh-pages-branch/xyz ?

yukiisbored commented 6 years ago

@nalinbhardwaj see https://docs.travis-ci.com/user/deployment/pages/

yukiisbored commented 6 years ago

Also, If you want to see an example: https://github.com/yukiisbored/blog-archive/blob/blog/.travis.yml

yukiisbored commented 6 years ago

@nalinbhardwaj just asked @jayvdb, it seems SSH deploy keys are preferred so I'm gonna merge this, but I need to setup the deploy keys.

yukiisbored commented 6 years ago

Marking this as blocked since the builds are failing.

nalinbhardwaj commented 6 years ago

For future readers, some discussion regarding the decisions can be found in Zulip.

yukiisbored commented 6 years ago

Sadly we can't merge it, master is broken :(

yukiisbored commented 6 years ago

ack https://github.com/coala/coala-html/pull/143/commits/70dfa009d4c8637d44639b36698794a06f8bcb2c

nalinbhardwaj commented 6 years ago

Umm, @yukiisbored I think you forgot about the TODO from my PR description? That encrypted deploy key won’t work for this repo?