PR-Automation

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2020 License: MIT Imports: 6 Imported by: 0

README

GitHub Action to Deploy static website to S3 Bucket and comment the Url to PR☁

This action uses the golang aws sdk to build aws static website bucket and deploy the static file to that newly created s3 bucket and comment the url to the PR. To deploy static file it uses either from your repository or build during your workflow. Dockerfile and s3 utils can be found on Link.

Usage

deploy-pr.yml and cleanup-pr.yml Example

Place in a .yml file such as this one in your .github/workflows folder. Refer to the documentation on workflow YAML syntax here.

The following example includes optimal defaults for a any client side javascript static website:
  • It build the javascript/typescript frontend application with the help of given command (ex: BUILD_COMMAND="yarn build")
  • If If it't PR then it will comment the URL of the static site to the PR
  • It also delete the Build s3 bucket on PR merge or close
name: Deploy site to S3 And add comment to PR

on:
  pull_request:
    branches:
    - master

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: razz
      with:
        args: --acl public-read --follow-symlinks --delete
      env:
        AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_REGION: 'us-west-1'   # optional: defaults to us-east-1
        SOURCE_DIR: 'public'      # optional: defaults to entire repository

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL