Skip to content

add deploy.sh

add deploy.sh #51

Workflow file for this run

name: Deploy to S3
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
AWS_S3_BUCKET_NAME: webduino-chat
steps:
- uses: actions/checkout@master
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".tool-versions"
- name: Cache npm packages
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-
- name: Install Dependencies
run: npm ci
- name: Build Application
run: |
export NODE_OPTIONS=--openssl-legacy-provider
npm run build
- uses: jakejarvis/s3-sync-action@master
name: Upload App to S3 Bucket
with:
args: --follow-symlinks --delete --exclude '.git/*' --exclude 'node_modules/*'
env:
AWS_S3_BUCKET: ${{ env.AWS_S3_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "ap-northeast-2"
SOURCE_DIR: "."
DEST_DIR: "pro"