feat: support cached

This commit is contained in:
sealday 2024-04-19 18:31:26 +08:00
parent e9a090d674
commit 48d4f8a86b
2 changed files with 15 additions and 28 deletions

View File

@ -10,17 +10,16 @@ permissions:
jobs: jobs:
CI: CI:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:20
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: config registry - name: Install Node.js
run: npm config set registry https://npm.daoyoucloud.com/ uses: actions/setup-node@v4
- name: install pnpm
uses: pnpm/action-setup@v3
with: with:
standalone: true node-version: 20
- name: Install dependencies registry-url: ${{ vars.REGISTRY_URL }}
cache: 'pnpm'
- name: Install deps
run: pnpm install run: pnpm install
- name: Build - name: Build
run: pnpm build:p run: pnpm build:p

View File

@ -10,32 +10,20 @@ permissions:
jobs: jobs:
CI: CI:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:20
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: config registry - name: Install Node.js
run: npm config set registry https://npm.daoyoucloud.com/ uses: actions/setup-node@v4
- name: install pnpm
uses: pnpm/action-setup@v3
with: with:
standalone: true node-version: 20
- name: Get pnpm store directory registry-url: ${{ vars.REGISTRY_URL }}
shell: bash cache: 'pnpm'
run: | - name: Install deps
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: pnpm-store
- name: Install dependencies
run: pnpm install run: pnpm install
- name: Build - name: Build
run: pnpm build:p run: pnpm build:p
- name: show status - name: Publish
run: git status
- name: publish
run: pnpm publish -r --registry=https://npm.daoyoucloud.com --publish-branch ${{ gitea.ref }}
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPMTOKEN }}
run: pnpm -r publish --access=public --no-git-checks --publish-branch ${{ gitea.ref }}