Skip to content

Instantly share code, notes, and snippets.

@Markkos89
Created November 15, 2020 05:03
Show Gist options
  • Save Markkos89/64d07dca2597136e2c6e67c05d3efd8b to your computer and use it in GitHub Desktop.
Save Markkos89/64d07dca2597136e2c6e67c05d3efd8b to your computer and use it in GitHub Desktop.
name: Deploy React app in S3 Bucket
on:
workflow_dispatch:
inputs:
tags:
description: "Deploy manual client"
push:
branches:
- master
paths:
- "packages/client/*"
defaults:
run:
working-directory: ./packages/client
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Build dist
env:
NODE_ENV: production
run: |
npm install
npm run build
- name: Deploy on S3
env: # Or as an environment variable
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
run: |
pip3 install setuptools
pip3 install awscli
aws s3 sync --acl public-read build/ s3://${{ secrets.AWS_BUCKET }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment