Merge pull request #341 from OsmHackTW/dependabot/npm_and_yarn/cssnan… #4
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: deploy | |
on: | |
push: | |
branches: | |
- main | |
- master | |
jobs: | |
deploy: | |
runs-on: ${{ matrix.os }} | |
env: | |
NODE_ENV: production | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [18] | |
steps: | |
- name: Checkout 🛎 | |
uses: actions/checkout@v3 | |
- name: Cache 💾 | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }} | |
- name: Install and Build 🔧 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: | | |
yarn ci | |
yarn build | |
yarn export | |
touch ./out/.nojekyll | |
env: | |
CI: true | |
NODE_ENV: production | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
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 |