name: build and deploy

on:
  push:
    branches: ["master"]
permissions:
  contents: write
env:
  CI: false
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Build
        run: |
          npm install
          npm run-script build
        env:
          REACT_APP_API_KEY: ${{ secrets.REACT_APP_API_KEY }}
      - name: Deploy to GitHub Pages
        uses: JamesIves/github-pages-deploy-action@releases/v4
        with:
          # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          BRANCH: gh-pages
          FOLDER: build
