name: Node CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x]

    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
    - name: Set up npm7
      run: npm i -g npm@7
    - name: install dependencies
      run: |
        npm ci
    - name: build
      env:
        RELATIVE_CI_KEY: ${{ secrets.RELATIVE_CI_KEY }}
        RELATIVE_CI_SLUG: nextcloud/deck
      run: |
        mkdir -p js
        npm run build --if-present -- --profile --json | tail -n +6 > js/webpack-stats.json
        npx relative-ci-agent


