Skip to content

feat: CI/CD

feat: CI/CD #3

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org # 发布时要用到
- name: Config Git # npm publish 必须
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Publish to NPM
run: |
yarn
npm run test
npm version ${{ github.ref_name }}
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Pages
run: |
cp -r .git test/ && cd test
git checkout --orphan gh-pages
git add .
git commit -m "publish pages"
git push --force --progress "origin" gh-pages