chore: 节约 ci 资源

This commit is contained in:
wuxh 2024-07-12 12:48:49 +08:00
parent da5260fd48
commit 0a3bb297f3
No known key found for this signature in database
GPG Key ID: 4E035332466F0370

View File

@ -1,8 +1,14 @@
name: Publish Any Commit
on: [push, pull_request]
name: Continuous Releases
on:
workflow_run:
workflows: ["✅ test"]
types:
- completed
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
@ -14,9 +20,20 @@ jobs:
with:
node-version: 20
- name: Install dependencies
run: npm install
# ========== Prepare package ==========
- name: restore cache from package-lock.json
uses: actions/cache@v4
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v4
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
# ========== build ==========
- name: Build
run: npm run build