2021-11-13 03:05:05 +08:00
|
|
|
name: Generator
|
2021-11-13 02:56:41 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2022-12-31 04:04:03 +08:00
|
|
|
# One generator at a time
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-12-31 04:11:35 +08:00
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
2021-11-13 02:56:41 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-03-21 00:53:16 +08:00
|
|
|
- name: Checkout
|
2022-08-30 21:52:20 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-03-21 00:53:16 +08:00
|
|
|
- name: Setup Node
|
2022-08-30 21:52:20 +08:00
|
|
|
uses: actions/setup-node@v3
|
2021-11-13 02:56:41 +08:00
|
|
|
with:
|
2022-08-30 21:52:20 +08:00
|
|
|
# Upgrading to 16.17.0 result in ERR_LOADER_CHAIN_INCOMPLETE issue.
|
|
|
|
node-version: 16.16.0
|
|
|
|
|
2022-03-21 00:53:16 +08:00
|
|
|
- name: Cache node_modules
|
2022-08-30 21:52:20 +08:00
|
|
|
uses: actions/cache@v3
|
2022-03-21 00:53:16 +08:00
|
|
|
id: cache
|
2021-11-13 03:05:05 +08:00
|
|
|
with:
|
2022-03-21 00:53:16 +08:00
|
|
|
path: node_modules
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
|
|
|
|
restore-keys: ${{ runner.os }}-node-
|
2022-08-30 21:52:20 +08:00
|
|
|
|
2022-03-21 00:53:16 +08:00
|
|
|
- name: Install Dependencies
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --production --frozen-lockfile
|
2022-08-30 21:52:20 +08:00
|
|
|
|
2022-03-21 00:53:16 +08:00
|
|
|
- name: Build
|
|
|
|
run: yarn build
|
2022-08-30 21:52:20 +08:00
|
|
|
|
2022-12-31 04:11:35 +08:00
|
|
|
- name: Deploy to github pages
|
2022-12-31 04:23:38 +08:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
2022-12-31 04:11:35 +08:00
|
|
|
with:
|
|
|
|
branch: gh-pages
|
|
|
|
folder: dist
|