name: Build and deploy
on:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Read .nvmrc
        run: echo ::set-output name=NVMRC::$(cat .nvmrc)
        id: nvm

      - name: Set up Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '${{ steps.nvm.outputs.NVMRC }}'

      - name: Install dependencies
        run: |
          npm install
          echo "$(npm bin)" >> $GITHUB_PATH

      - name: Build dist
        run: |
          npm run build

      - name: Deploy
        uses: JamesIves/github-pages-deploy-action@4.1.7
        with:
          single-commit: true
          branch: gh-pages
          folder: dist
          ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

Set up GitHub Actions for deploying to gh-pages
Set up GitHub Actions for deploying to gh-pages
