Skip to content

Commit

Permalink
chore: update pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
S-N-O-R-L-A-X committed Sep 29, 2024
1 parent c5cda85 commit 938f017
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 47 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: art-component-deploy
on:
push:
branches:
- "main" # change to the branch you wish to deploy from

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.build-publish.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- id: build-publish
uses: bitovi/[email protected]
with:
path: storybook-static # change to your build folder
build_command: npm run build-storybook
47 changes: 0 additions & 47 deletions .github/workflows/main.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Npm publish
on:
push:
tags:
- "v*" # 这段的意思是仅在出现名为 v 字符开头的tag时,触发此任务,如v1.2.1

permissions:
contents: read
pages: write
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.2.0
- name: Install dependencies
run: |
npm ci
npm run build
- name: Add Npm Token # add access token to .npmrc
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ./.npmrc
ls -al
cat ./.npmrc
- name: Publish to npm # publish to npm registry
run: npm publish
env:
GITHUB_TOKEN: ${{ secrets.ART }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 938f017

Please sign in to comment.