Inkpaper Best Practices-Automatically deploy INK blogs to GitHub pages with Travis CI

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Brief introduction

Paper Ink (inkpaper) is an open source static blog building tool written in go language that allows you to quickly build a blog site. It has no dependencies on cross-platform, simple configuration, quick to build, easy to use and more elegant typography. Using Travis CI can solve the problem of automatic build and automatic deployment, so that we can focus on writing more.

What is Travis CI?

Travis CI is a distributed, continuous build service that provides build and test for projects on GitHub. This means that your static blog is best hosted in
On GitHub Pages. When the GitHub Pages warehouse activates the Travis CI service, GitHub notifies Travis CI when new changes to your blog are submitted to GitHub. It can also be configured to take effect only on a specific branch, or the name of a branch matches a specific pattern. Travis CI will check the relevant branches and execute the commands previously configured in. travis.yml, usually. TRAVIS.YML is used to configure the auto-build and automated test commands, in this article we will run the ink build using Travis CI, Then push to the GitHub Pages Branch. When the build is complete, Travis notifies the developer in the way it was previously configured.

Configuration

Before you start, make sure that your blog's static library has two branches, one that puts the ink Blog source file, and the other a GitHub Pages file. For example, I created a branch called Blog-source Store my ink blog source file, another branch called Master managed
GitHub Pages file.

    1. Log in to Travis CI with your GitHub account.

    2. After logging in, go to your configuration page and enable Travis CI for the warehouse you want to build.

    3. Add GitHub Access tokensto the corresponding warehouse in Travis CI for subsequent use of the GitHub API. This allows Travis CI to push the static blog source files generated by Inkpaper to the GitHub Pages branch.

    4. Add the . travis.yml file to your warehouse and tell Travis CI what to do.

    5. After you add the . travis.yml file, the local modifications are committed to the remote to trigger the Travis CI build.

Now

When we complete our new blog, we just need to submit the source file to Github's remote repository, and Travis CI will do the rest. We just need to focus on writing, that's all.

You can find the source code mentioned in this article on Github: Https://github.com/shery15/blog

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.