mirror of
https://github.com/one-among-us/data.git
synced 2024-11-10 13:24:50 +08:00
dc9a7aefd7
Former-commit-id: 3a72378914
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: Generator
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
# One generator at a time
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
# Upgrading to 16.17.0 result in ERR_LOADER_CHAIN_INCOMPLETE issue.
|
|
node-version: 16.16.0
|
|
|
|
- name: Cache node_modules
|
|
uses: actions/cache@v3
|
|
id: cache
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
|
|
restore-keys: ${{ runner.os }}-node-
|
|
|
|
- name: Install Dependencies
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: yarn install --production --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: yarn build
|
|
|
|
- name: Deploy
|
|
run: |
|
|
git config --global user.name "$(git show -s --format='%an' HEAD)"
|
|
git config --global user.email "$(git show -s --format='%ae' HEAD)"
|
|
|
|
cd dist
|
|
git init
|
|
git add .
|
|
git commit -m "Build on $(date '+%Y-%m-%d %H:%M:%S')"
|
|
git branch -m gh-pages
|
|
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
|
git push -f origin gh-pages
|