GithubHelp home page GithubHelp logo

matthewa26 / s3publishdeploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johnbehnke/s3publishdeploy

0.0 0.0 0.0 5 KB

A deployment method for Publish to upload files to AWS S3

Swift 100.00%

s3publishdeploy's Introduction

S3PublishDeploy

A deployment method for Publish to upload files using to a S3.

Preface

If you want to learn how to configure a S3 bucket for static site hosting, you can learn how to here

Ensure you have the AWS CLI installed and configured. You should have a file located at ~/.aws/config that contains a default AWS region. You should also have a file located at ~/.aws/credentials that contains your Access Key Id and Secret Access Key. _

Download and installation for the AWS CLI are located here

Installation

Add S3PublishDeploy to your Package.swift file.

let package = Package(
    ...
    dependencies: [
        .package(url: "https://github.com/johnbehnke/s3publishdeploy", from: "0.1.0")
    ],
    targets: [
        .target(
            ...
            dependencies: [
                ...
                "S3PPublishDeploy"
            ]
        )
    ]
    ...
)

Usage

You can then declare your deployment method in your pipeline:

import S3PublishDeploy
...
try Website().publish(using: [
    ...
    .deploy(using: .s3(bucket: "my-test-bucket))
])

By default, the package assumes you have the AWS CLI installed at /usr/local/bin/aws. If you want to provide a different AWS binary, you can pass the pathToAWSBinary and give the full path to the binary.

By defualt, the package will deploy using the sync argument set to true. This will ensure the state of the S3 bucket matches the state of the Output directory exactly. If you have files in your bucket that are not present in your static site directory and you don't want those files to be removed, set the sync argument to false.

Acknowledgement

Thanks to John Sundell (@johnsundell) for creating Publish

License

MIT License

s3publishdeploy's People

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.