Skip to content

Build and deploy

Build and deploy #658

Workflow file for this run

name: Build and deploy
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * *' # Every day
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@master
with:
persist-credentials: false
- name: Load cache ⚙️
uses: actions/cache@v3
with:
path: |
~/.yarn
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
- name: Install 🔧
run: |
yarn install
- name: Build and static exports 🏗️
env:
CONTENTFUL_TOKEN: ${{ secrets.CONTENTFUL_TOKEN }}
CONTENTFUL_SPACE_ID: ${{ secrets.CONTENTFUL_SPACE_ID }}
run: |
yarn typecheck
yarn build
yarn export
- name: Deploy to GH Pages 🚀
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages