one-among-us-data/.github/workflows/generator.yml

63 lines
1.5 KiB
YAML
Raw Normal View History

2021-11-13 03:05:05 +08:00
name: Generator
2021-11-13 02:56:41 +08:00
on:
push:
branches: [ main ]
workflow_dispatch:
# One generator at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
2021-11-13 02:56:41 +08:00
jobs:
build:
runs-on: ubuntu-latest
2023-01-06 01:21:02 +08:00
permissions: write-all
2021-11-13 02:56:41 +08:00
steps:
2023-01-06 01:17:07 +08:00
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
2021-11-13 02:56:41 +08:00
with:
2023-01-06 01:17:07 +08:00
node-version: 18
2022-08-30 21:52:20 +08:00
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
- name: Deploy to github pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
2023-01-06 01:17:07 +08:00
- name: Trigger web repackage
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'one-among-us',
repo: 'web',
workflow_id: 'package.yml',
ref: 'main'
})