Upstream CI(Chinese Independent Blogs) #132
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: Upstream CI(Chinese Independent Blogs) | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # Daily at midnight | |
jobs: | |
build: | |
strategy: | |
matrix: | |
node-version: [18.x] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache pnpm modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-pnpm-modules | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: latest | |
run_install: true | |
- name: Install dependencies | |
run: pnpm i --no-optional | |
- name: Build project | |
run: | | |
npm run start |