name: Deploy BioThings Studio Webapp to S3

on:
  push:
    branches:
    - master

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: actions/setup-node@v1
      with:
        node-version: '12'
    - run: npm install
    - run: npm run build
    - uses: jakejarvis/s3-sync-action@master
      with:
        args: --acl public-read --follow-symlinks --delete
      env:
        AWS_S3_BUCKET: ${{ secrets.STUDIO_S3_BUCKET }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_REGION: ${{secrets.AWS_REGION}}
        SOURCE_DIR: './biothings/hub/webapp/dist'
        DEST_DIR: 'master'

name: Deploy BioThings Studio Webapp to S3

on:
  push:
    branches:
    - master

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: actions/setup-node@v1
      with:
        node-version: '12'
    - run: npm --prefix biothings/hub/webapp/ install
    - run: npm --prefix biothings/hub/webapp/ run build
    - uses: jakejarvis/s3-sync-action@master
      with:
        args: --acl public-read --follow-symlinks --delete
      env:
        AWS_S3_BUCKET: ${{ secrets.STUDIO_S3_BUCKET }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_REGION: ${{secrets.AWS_REGION}}
        SOURCE_DIR: './biothings/hub/webapp/dist'
        DEST_DIR: 'master'

Add '--prefix' to npm commands
Add '--prefix' to npm commands