Build and deploy #661
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |