name: Build and Deploy on: push: branches: - main jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@v2 - name: Cache Hydration ๐Ÿงถ uses: actions/cache@v2 with: path: | ${{ github.workspace }}/.next/cache node_modules key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }} - name: Install and Build ๐Ÿ”ง run: | yarn install --frozen-lockfile yarn run build yarn run export cp CNAME ./out touch ./out/.nojekyll - name: Deploy ๐Ÿš€ uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. FOLDER: out # The folder the action should deploy. CLEAN: true # Automatically remove deleted files from the deploy branch