Creating .travis.yml file to auto-deploy to gh-pages

23 views
Skip to first unread message

Aaron Meurer

unread,
Aug 22, 2016, 3:37:00 AM8/22/16
to nikola-...@googlegroups.com
Does Nikola have the ability to automatically generate a .travis.yml
file to build and deploy the site to gh-pages? If not, is that
something that you would be interested in adding?

Aaron Meurer

tritiu...@sdamon.com

unread,
Aug 22, 2016, 3:38:23 AM8/22/16
to nikola-...@googlegroups.com
Nikola has built in github pages deployment.

https://getnikola.com/handbook.html#deploying-to-github
> --
> You received this message because you are subscribed to the Google Groups
> "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nikola-discus...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Aaron Meurer

unread,
Aug 22, 2016, 3:52:00 AM8/22/16
to nikola-...@googlegroups.com
Yes, I know about that. It's what I use currently. But I'd like to
build and deploy my site on Travis CI.

Basically, I want a command, like nikola configure-travis, which

- Sets up a deploy key for GitHub, and encrypts it.
- (Optionally) uploads said key to GitHub
- Creates a .travis.yml file with the encryption key for the above
deploy key encrypted in an encrypted environment variable, with the
steps to install nikola, build the site, and run nikola github_deploy.
- (Optionally) authenticates to and enables Travis (assuming this is
possible from the API)
- (Optionally) runs git add on the encrypted deploy key and
.travis.yml so that I can commit them.

By the way, for the first two steps, I've written a tool that can be
useful, https://github.com/drdoctr/doctr.

Aaron Meurer

Roberto Alsina

unread,
Aug 22, 2016, 6:21:17 AM8/22/16
to nikola-...@googlegroups.com
Sounds useful!

Puneeth Chaganti

unread,
Aug 22, 2016, 6:23:56 AM8/22/16
to nikola-...@googlegroups.com

Aaron,

> Yes, I know about that. It's what I use currently. But I'd like to
> build and deploy my site on Travis CI.

I had written something a while back, that tries to do this:

http://statiki.herokuapp.com/
https://github.com/punchagan/statiki

I no longer maintain it, but it should still work. Or should at least help
someone wanting to write a nikola command.

Thanks,
Puneeth

Damián Avila

unread,
Aug 22, 2016, 7:42:12 AM8/22/16
to nikola-discuss
I would be interesting to see something like you described Aaron.
To encrypt variables on travisci you probably need to interact with the travis command line application written in ruby, IIRC... so it would be, I guess, a nice interesting mix of languages ;-)


--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Damián

Aaron Meurer

unread,
Aug 22, 2016, 2:22:39 PM8/22/16
to nikola-...@googlegroups.com
I wrote the code to do it in Python in the tool doctr that I mentioned. So you can reuse that. 

Aaron Meurer 

Aaron Meurer

unread,
Jun 19, 2017, 4:54:45 PM6/19/17
to nikola-...@googlegroups.com
So an update on this. You can use doctr to deploy your pages to
gh-pages from Travis quite easily. This is much better than the method
outlined in the Nikola docs, because doctr handles the SSH key stuff
for you automatically. I also found that nikola github_deploy was
doing too much, so I also use doctr to do the actual syncing of files
to the gh-pages branch.

It's really simple to do. I wrote a blog post about it here
http://www.asmeurer.com/blog/posts/automatically-deploying-this-blog-to-github-pages-with-travis-ci/

Aaron Meurer
>>> email to nikola-discus...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> Damián
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "nikola-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to nikola-discus...@googlegroups.com.

Damián Avila

unread,
Jun 21, 2017, 8:33:25 AM6/21/17
to nikola-discuss
Thanks for sharing Aaron!


>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> Damián
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "nikola-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an

>> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Damián Avila
Reply all
Reply to author
Forward
0 new messages