# GitHub Actions allows you to build, test, and deploy applications in your language of choice
name: Node CI

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: main

jobs:
  build:
    name: Build on node ${{ matrix.node_version }} and ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-20.04]
        node_version: [12.x]

    runs-on: ${{ matrix.os }}

    steps:
    # checkout the repo
    - name: Checkout the repo
      uses: actions/checkout@v2

    # use node.js matrix
    - name: Use Node.js ${{ matrix.node_version }}
      uses: actions/setup-node@v2-beta
      with:
        node-version: ${{ matrix.node_version }}

    # install dependencies, verify, test and build
    - name: Clean install dependencies and build
      run: |
        yarn install
        yarn run verify
        yarn run test
        yarn run build
      env:
        CI: true

    # deploy web app using publish profile credentials
    # coming soon
