GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - adgorithmics-inc/upload-s3-action: github action for upload to S3 ☁️

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

58 Commits
58 Commits

Folders and files

NameName
Last commit message
Last commit date
dist
dist
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 
index.js
index.js
 
 
package.json
package.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

Upload S3 ☁️

This action upload directory to AWS S3 by public read and output key that generated by shortid

Note - The last source_dir name(foo/bar/will-be-replace) will be replaced to the key generated as shortid. The reason is that upload a new one every time and I want to access s3 with a new key value. If you want to upload a single file, be sure to create a folder and upload it.

Usage

workflow.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.

name: Upload to S3

on: [pull_request]

jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: shallwefootball/s3-upload-action@master
        with:
          aws_key_id: ${{ secrets.AWS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
          aws_bucket: ${{ secrets.AWS_BUCKET }}
          source_dir: 'dirname'

Recommend using with deployment-action in pull request.

name: Deploy for preview

on: [pull_request]

jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: chrnorm/deployment-action@releases/v1
        name: Create GitHub deployment
        id: test
        with:
          token: ${{ secrets.GITHUB_TOKEN}}
          description: 'Preview my app'
          environment: preview

      - uses: shallwefootball/s3-upload-action@master
        name: Upload S3
        id: S3
        with:
          aws_key_id: ${{ secrets.AWS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
          aws_bucket: ${{ secrets.AWS_BUCKET }}
          source_dir: 'static'

      - name: Update deployment status (success)
        if: success()
        uses: chrnorm/deployment-status@releases/v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          target_url: https://aws-bucket.s3.ap-northeast-2.amazonaws.com/${{steps.S3.outputs.object_key}}/index.html
          state: 'success'
          deployment_id: ${{ steps.test.outputs.deployment_id }}

Action inputs

The following settings must be passed as environment variables as shown in the example. Sensitive information, especially aws_key_id and aws_secret_access_key, should be set as encrypted secrets — otherwise, they'll be public to anyone browsing your repository's source code

name description
aws_key_id (Required) Your AWS Access Key. More info here.
aws_secret_access_key (Required) Your AWS Secret Access Key. More info here.
aws_bucket (Required) The name of the bucket you're upload to.
source_dir (Required) The local directory (or file) you wish to upload to S3. The directory will replace to key generated by shortid in S3
destination_dir (Optional) The destination directory in S3
If this field is excluded a shortid will be generated
endpoint (Optional) The endpoint URI to send requests to. More info here.

To upload to the root directory, set destination_dir: '' in action.yml

Action outputs

name description
object_key Uploaded object key generated by shortid in Bucket
object_locations Object Locations

About

github action for upload to S3 ☁️

github.com/marketplace/actions/upload-s3

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.