Skip to content

eisberg-labs/static-website-to-s3

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Deploy NextJS

Static website to S3 Github action

This action will deploy your static website to S3 without the html extension.

I tested only with NextJS exported website, but I don't see any reason why it shouldn't work with other setups. If it's not working for you, please report an issue.

Prerequisite

You have configured your S3 bucket for static website hosting.

Usage

Define AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. This action should be run after the static website is built:

 - name: Deploy to s3
   uses: eisberg-labs/static-website-to-s3@main
   with:
     target: nextjs-testapp/out
     dest: next-to-s3/nextjs-testapp
     exclusions: ^nextjs-testapp\/out\/(index|404).html$
     bucket: ${{ secrets.BUCKET }}

Example

There's an example action at Actions, and configuration file testing the NextJS build.

License

MIT © Eisberg Labs