name: NodeJS with Webpack

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [18.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: install
      run: |
        npm install

    - name: test
      run: |
        npm test
        npm run build
        
    - name: build
      run: |
        npm run build

name: NodeJS with Webpack

on:
  push:
    branches: ["master"]
  pull_request:
    branches: ["master"]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [18.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: install
        run: |
          npm install

      - name: test
        run: |
          npm test

      - name: build
        run: |
          npm run build

      - name: upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: github-pages
          path: dist
  deploy:
    runs-on: ubuntu-latest
    needs: build
    # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
    permissions:
      pages: write # to deploy to Pages
      id-token: write # to verify the deployment originates from an appropriate source

    steps:
      - uses: actions/download-artifact@v2
        with:
          name: github-pages
          path: dist
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1

Deploy site to github pages from github action
Deploy site to github pages from github action
