Test CI #3
Workflow file for this run
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: Test Build | |
on: | |
workflow_call: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
with: | |
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
# cache node_modules | |
- name: Cache pnpm modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}- | |
- name: Install dependencies | |
uses: pnpm/action-setup@v2 | |
with: | |
run_install: true | |
# 构建 | |
- name: Build | |
run: pnpm build | |
- run: | | |
zip -r _site.zip .vitepress/dist | |
- name: upload _site artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: _site | |
path: _site.zip | |
retention-days: 5 | |
- name: Save PR number | |
if: ${{ always() }} | |
run: echo ${{ github.event.number }} > ./pr-id.txt | |
- name: Upload PR number | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pr | |
path: ./pr-id.txt |