http://www.slowcoder.com Are you tired of maintaining your (WordPress, Drupal, etc) ? Paying expensive hosting fees ? Fixing security issues everyday ? CMS I discovered not long ago a new blogging framework called which let you publish documents in the form of blog post. So as always I got my hands dirty and wrote this post to show you how to build a production-ready blog with and use the to make your blog and pay only per usage. Along the way, I will show you how to automate the deployment of new posts by setting up a pipeline. Hexo Markdown Hexo AWS S3 Serverless CI/CD To get started**, Hexo** requires & to be installed. Once all requirements are installed, issue the following command to install : Node.JS Git Hexo CLI npm install -g hexo-cli Next, create a new empty project: hexo init slowcoder.com Modify blog global settings in file: _config.yml Start a local server with “ “. By default, this is at . You’ll see Hexo’s pre-defined “ ” test post: hexo server http://localhost:4000 Hello World If you want to change the default theme, you just need to go and find a new one you prefer. here I opt for as it includes many features: Magnetic Theme Disqus and Facebook comments Google Analytics Cover image for posts and pages Tags Support Responsive Images Image Gallery Social Accounts configuration Pagination Clone the theme repository as below: GitHub git clone themes/magnetic https://github.com/klugjo/hexo-theme-magnetic Then update your blog’s main to set the theme to . Once done, restart the server_:_ _config.yml magnetic Now you are almost done with your blog setup. It is time to write your first article. To generate a new article file, use the following command: hexo new POST_TITLE Now, sign in to , navigate to and create an or use the to create a new one: AWS Management Console S3 Dashboard S3 Bucket AWS CLI aws s3 mb s3://slowcoder.com Add the following to the to make all objects public by default: policy S3 bucket Next, enable on the S3 bucket: static website hosting aws s3 website s3://slowcoder.com — index-document index.html In order to automate the process of deployment of the blog to production each time a new article is been published. We will setup a pipeline using . CI/CD CircleCI Sign in to using your account, then add the file to your project: CircleCI GitHub circle.yml Note: Make sure to set the and in your Project’s Settings page on ( permission). AWS Access Key ID Secret Access Key CircleCI s3:PutObject Now every time you push changes to your repo, will automatically deploy the changes to . Here’s a passing build: GitHub CircleCI S3 Finally, to make our blog user-friendly, we will setup a custom domain name in as below: Route53 Note: You can go further and setup a in front of the bucket to optimize delivery of blog assets. CloudFront Distribution S3 You can test your brand new blog now by typing the following adress: : http://slowcoder.com
Share Your Thoughts