Skip to content

Instantly share code, notes, and snippets.

@albisserAdrian
Created July 17, 2020 03:17
Show Gist options
  • Save albisserAdrian/8e95667ef69fe3b8f5d26a98b78e74cf to your computer and use it in GitHub Desktop.
Save albisserAdrian/8e95667ef69fe3b8f5d26a98b78e74cf to your computer and use it in GitHub Desktop.
Monorepo react-app to S3 GitHub action.
name: Client Build
on:
push:
branches:
- master
defaults:
run:
working-directory: <DIRECTORY_PATH>
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish Client
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Yarn Install
run: |
yarn install
- name: Yarn Build
run: |
yarn build
- name: Deploy static site to S3 bucket
run: aws s3 sync ./build s3://<S3_BUCKET_NAME> --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment