GithubHelp home page GithubHelp logo

middleman-aws-deploy's Introduction

Middleman AWS Deploy

Deploys build files to S3 at the end of the Middleman build toolchain, and/or invalidates Cloudfront.

In your config.rb file, add.

configure :build do
  # ...
  if ENV.include?('DEPLOY')
    activate :s3_deploy do |s3|
      s3.access_key_id = ENV['AWS_ACCESS_KEY_ID']
      s3.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
      s3.bucket = ENV['AWS_S3_BUCKET']
    end
    activate :invalidate_cloudfront do |cf|
      cf.access_key_id = ENV['AWS_ACCESS_KEY_ID']
      cf.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
      cf.distribution_id = ENV['AWS_CLOUDFRONT_DIST_ID']
    end
  end
end

With valid AWS creds, an s3 bucket, and cloudfront distribution id, you can deploy with the env var DEPLOY as a trigger (you can use whichever kind of trigger you like):

DEPLOY=true middleman build

S3 Deployment Note

The S3 deployer will check local file's md5 hash against the remote s3 etag. If they are the same, it will not upload the identical file. However, if you have :cachebuster set to active the hashes will always end up different on every build, triggering an upload. There's little such danger however for assets (css, images, etc).

middleman-aws-deploy's People

Contributors

coderoshi avatar

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.