Skip to content

chore: deploy workflow #10

chore: deploy workflow

chore: deploy workflow #10

Workflow file for this run

name: Deploy
on:
# release:
# types: [published]
push: # push 到主分支自动 发布
branches: ['master']
paths-ignore: # 忽略一些不必要的文件
- '.gitignore'
- 'README.md'
- '.vscode/**'
- '.devcontainer/**'
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: 'production'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16.14'
- name: Cache Dependencies
uses: actions/cache@v3
id: cache
with:
path: |
node_modules
.yarn/cache
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --mode=skip-build
- name: Configure Git User
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{github.actor}}"
git config --list
- name: Authenticate with Registry
run: |
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish
run: |
npx lerna publish --yes
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}