Code Monkey home page Code Monkey logo

mkdocs-codepipeline-github-to-s3's Introduction

AWS CodePipeline to Deploy Mkdocs project from GitHub to Amazon S3 Bucket

Diagram

Create a personal access token for GitHub

You need a personal access token for GitHub and must have the following scopes.

  • repo: Grants full control of private repositories.
  • repo:status: Grants access to commit statuses.
  • admin:repo_hook: Grants full control of repository hooks. This scope is not required if your token has the repo scope.

https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line

Create you first Mkdocs project

Install the mkdocs and material design package using pip.

sudo pip install mkdocs
sudo pip install mkdocs-material

https://www.mkdocs.org

https://squidfunk.github.io/mkdocs-material/

Create the Mkdocs project.

mkdocs new my-project
cd my-project

Append the following line to your project's mkdocs.yml.

theme:
  name: 'material'

Create a new buildspec.yml file inside your project with the following lines.

version: 0.2
phases:
  install:
    runtime-versions:
      python: 3.7
    commands:
      - pip install --upgrade pip
      - pip install --upgrade awscli
      - pip install mkdocs
      - pip install mkdocs-material
  pre_build:
    commands:
      # Discover and run unit tests in the 'tests' directory
  build:
    commands:
      # Build
      - mkdocs build
  post_build:
    commands:
      # Post Build

artifacts:
  base-directory: 'site*'
  files:
    - '**/*'

Your project files.

Tree

Now create a new GitHub repository for your mkdocs project and push the changes.

Create the CodePipeline to deploy changes automatically to your Amazon S3 Website

Download the CloudFormation template AURBAC-mkdocs-codepipeline-github-to-s3.json and launch in your selected region to create the AWS CodePipeline and an Amazon S3 Bucket for your WebSite.

Wait until stack status is CREATE_COMPLETE and go to the AWS CodePipeline console, automatically the pipeline release a change and deploy to your Amazon S3 Bucket.

CodePipeline

In the Outputs of your CloudFormation Stack you will find the link to your Website.

Mkdocs project deployed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.