Skip to content

refactor: modularize code #15

refactor: modularize code

refactor: modularize code #15

Workflow file for this run

name: Build and Deploy
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Cache 💾
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-v3-${{ hashFiles('**/package-lock.json') }}
- name: Install and Build 🔧
uses: actions/setup-node@v1
with:
node-version: '16'
- run: npm install
- run: npm run build
env:
CI: false
- name: Deploy 🚀
if: github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
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