30 lines
900 B
YAML
30 lines
900 B
YAML
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
|
|
key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}
|
|
|
|
- name: Install and Build 🔧
|
|
run: |
|
|
yarn install
|
|
yarn run build
|
|
yarn run export
|
|
cp CNAME ./out
|
|
- 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 |