name: ci on: push: branches: - '**' tags-ignore: - '*.*' pull_request: jobs: test: runs-on: ubuntu-latest strategy: matrix: node-version: [10.x, 12.x, 13.x, 14.x] steps: - uses: actions/checkout@v2 - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - name: Install dependencies run: npm install - name: Run tests run: npm run test - name: Coverage run: | npm install -g codecov npm run report-coverage gh-pages: needs: ['test'] if: success() && github.event_name == 'push' && github.repository_owner == 'retailcrm' && github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup Node.js uses: actions/setup-node@v1 with: node-version: 10.x - name: Generate doc run: npm run doc - name: Deploy doc uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./out deploy: needs: ['test'] if: success() && github.event_name == 'push' && github.repository_owner == 'retailcrm' && github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: 10.x - name: Build run: npm run build - name: Publish uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }}