GithubHelp home page GithubHelp logo

perxhealth / static-deploy-action Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.31 MB

๐Ÿš€ GitHub Action for deploying static assets to an S3 bucket which is behind a Cloudfront Distribution

License: MIT License

JavaScript 6.25% TypeScript 93.75%
deployment-automation github-action-javascript github-actions

static-deploy-action's Introduction

Perx Health

Static Deploy to AWS

This repository contains a GitHub Action allowing you to deploy assets, such as a static site, to an AWS S3 bucket.

It is also expected that the relevant bucket is behind a Cloudfront Distribution, against which the Action creates an Invalidation after successful deployment.

Usage

Add the following step to a GitHub Actions workflow.

- name: ๐Ÿš€ Deploy
  uses: perxhealth/static-deploy-action@v1
  with:
    from: dist/
    to: s3://your-s3-bucket-uri
    cloudfront-distribution-id: KJPAKNWQ4OR54

Inputs

The Action currently expects three required inputs, and no further optional inputs.

  1. from

    Path to a directory on local disk in which all files within will be uploaded, overwriting files in the S3 bucket with the same name.

  2. to

    Fully qualified S3 remote path. Must start with s3://.

  3. cloudfront-distribution-id

    Upon successful upload of the files nominated in from, this is the Cloudfront Distribution on which we'll create an Invalidation.

Outputs

The Action currently produces no outputs.

AWS Credentials

The Action currently expects AWS credentials to exist in the environment, with sufficient permissions to perform the following actions.

S3

  • ListObjects
  • PutObject
  • DeleteObject

Cloudfront

  • CreateInvalidation

Development

Follow the below steps to get up and running with a local, development copy of the Action.

Prerequisites

You will need the following tools installed on your machine.

Clone the repository

$ git clone [email protected]:perxhealth/static-deploy-action
$ cd static-deploy-action

Install dependencies

Firstly, you'll want to ensure the correct versions of the necessary system dependencies are installed.

$ asdf install

Note: optionally, you may need to install the necessary asdf plugins first.

$ asdf plugin add nodejs
$ asdf plugin add pnpm

Lastly, go ahead and install the Action's dependencies via pnpm

$ pnpm install

Development

There's no server to run, or any particular commands to be aware of during active development. The best way to make sure your changes behave as intended is to write unit tests.

The repositories maintainers will take care of packaging and releasing new versions after Pull Requests have been merged. Although, we plan to automate this in future if there's enough demand.

Testing

Ensure you write tests to cover any code or behaviour you introduce. The test suite can be run with the following command...

$ pnpm test

static-deploy-action's People

Contributors

dependabot[bot] avatar lukerollans avatar

Watchers

 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.