name: npm-publish 'banner-carousel'
on:
  push:
    branches: [master]
    paths:
      - "main/projects/banner-carousel/**"
jobs:
  npm-publish:
    name: npm-publish
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@master

      - name: Set up Node
        uses: actions/setup-node@master
        with:
          node-version: 12.x

      - name: Install Application Dependencies
        working-directory: ./main
        run: npm install

      - name: Install Package Dependencies
        working-directory: main/projects/banner-carousel
        run: npm install

      - name: Build Package
        working-directory: ./main
        run: npm run build:prod:banner-carousel

      - name: Publish
        uses: JS-DevTools/npm-publish@v1
        with:
          package: main/dist/banner-carousel/package.json
          token: ${{ secrets.NPM_AUTH_TOKEN }}
