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:
CI:
runs-on: ubuntu-latest
container: node:20
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: config registry
run: npm config set registry https://npm.daoyoucloud.com/
- name: install pnpm
uses: pnpm/action-setup@v3
- name: Install Node.js
uses: actions/setup-node@v4
with:
standalone: true
- name: Install dependencies
node-version: 20
registry-url: ${{ vars.REGISTRY_URL }}
cache: 'pnpm'
- name: Install deps
run: pnpm install
- name: Build
run: pnpm build:p

View File

@ -10,32 +10,20 @@ permissions:
jobs:
CI:
runs-on: ubuntu-latest
container: node:20
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: config registry
run: npm config set registry https://npm.daoyoucloud.com/
- name: install pnpm
uses: pnpm/action-setup@v3
- name: Install Node.js
uses: actions/setup-node@v4
with:
standalone: true
- name: Get pnpm store directory
shell: bash
run: |
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
node-version: 20
registry-url: ${{ vars.REGISTRY_URL }}
cache: 'pnpm'
- name: Install deps
run: pnpm install
- name: Build
run: pnpm build:p
- name: show status
run: git status
- name: publish
run: pnpm publish -r --registry=https://npm.daoyoucloud.com --publish-branch ${{ gitea.ref }}
- name: Publish
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 }}