npm-install icon indicating copy to clipboard operation
npm-install copied to clipboard

Add example with Node install

Open bahmutov opened this issue 4 years ago โ€ข 1 comments

More complex scenario similar to https://github.com/d3lm/ngx-drag-to-select/blob/master/.github/workflows/main.yml

  • set particular version of Node
  • install dependencies
  • run tests
  • maybe another job to have a matrix of Node versions?
  • maybe build an app and test it in separate jobs?

bahmutov avatar Oct 29 '20 15:10 bahmutov

This is my React App boiler plate which includes auto deployment too using Sam Kirkland's FTP Action

on:
  push:
    branches:
      - master
    paths:
      - 'client/**'

name:                       ๐Ÿงช Auto | Deploy
jobs:
  web-deploy:
    name:                   ๐ŸŽ‰ Deploy
    runs-on:                ubuntu-latest
    steps:
    - name:                 ๐Ÿšš Get latest code
      uses:                 actions/[email protected]

    - name:                 ๐Ÿฑโ€๐Ÿ‘ค Use Node.js 14.16.1
      uses:                 actions/setup-node@v2-beta
      with:
        node-version:       '14.16.1'

    - name:                 ๐Ÿ’ฅ Install & Cache Deps
      uses:                 bahmutov/[email protected]
      with:
        working-directory:  client

    - name:                 ๐Ÿ”จ Build Project
      run:                  INLINE_RUNTIME_CHUNK=false npm run build
      working-directory:    client

    - name:                 ๐Ÿงช Test Build
      run:                  npm test
      working-directory:    client

    - name:                 ๐Ÿงน Lint Build
      run:                  npm run lint:ts
      working-directory:    client

    - name:                 ๐Ÿ“‚ Sync files
      uses:                 SamKirkland/[email protected]
      with:
        server:             ${{ secrets.ftpserver }}
        username:           ${{ secrets.ftpuser }}
        password:           ${{ secrets.ftppass }}
        local-dir:          ./client/build/

YenHub avatar Jun 19 '21 23:06 YenHub