Requirements

  • Use pelican-quickstart to setup your pelican environment. This will ask you and setup most of the basic variables you need for your automation.
  • Also setup a Github repo for the blog you are going to be hosting.
  • You should be able to test your blog using make devserver.
  • Get your secret and access key for that IAM account; save this you are gonna need to add it as env variables in your CircleCI.
  • Before you can do this, you should be able to already do make s3_upload on your local environment.
  • If you don't know how to point your DNS to a s3 bucket, that's in another post.  

Step-by-step

  1. Log into you github account.
  2. Goto the marketplace to install CirclCI
  3. Add your project to CircleCI Projects
  4. Go to your "Setting->projects->(your repo)" and then find the "Environment Variables" tab, and add 'AWS_ACCESS_KEY_ID' and 'AWS_SECRET_ACCESS_KEY'.
  5. Make a ".circleci" folder, and inside that add a "config.yml" file.  

Setting up your config.yml for CircleCI

version: 2
jobs:
  build:
    docker:
      - image: circleci/python:3.6.1

    working_directory: ~/repo

    steps:
      - checkout

      - run:
          name: install dependencies
          command: |
            sudo pip install pelican markdown awscli
            git clone https://github.com/Pelican-Elegant/elegant.git && pelican-themes --install elegant

      - deploy:
          name: deploying to s3
          command: |
            make html
            make s3_upload
  • I have added the git clone line for installing themes, but you are free to use your own, or if you are having weird issues, try starting without a theme.

Published

Category

Code

Tags

Contact