generated from S-N-O-R-L-A-X/vite-react-ts-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34373d8
commit 2e6ff65
Showing
1 changed file
with
40 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
name: art-component-release | ||
on: | ||
push: | ||
branches: | ||
- "main" # change to the branch you wish to deploy from | ||
push: | ||
branches: | ||
- "main" # change to the branch you wish to deploy from | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
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 | ||
publish: | ||
runs-on: ubuntu-latest # 在 Ubuntu 最新版本上运行作业 | ||
steps: | ||
- name: Checkout code # 使用 actions/checkout 检出当前代码 | ||
uses: actions/checkout@v4 | ||
- name: Set up Node.js # 设置 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 # 添加access token到.npmrc | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.ART }}" >> ./.npmrc | ||
ls -al | ||
cat ./.npmrc | ||
- name: Publish to npm # 发布到 npm registry | ||
run: npm publish | ||
env: | ||
- NPM_TOKEN: ${{ secrets.ART }} # 读取github的secrets变量,这里的NPM_TOKEN是前面设置的变量名 | ||
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 | ||
|
||
publish: | ||
runs-on: ubuntu-latest # 在 Ubuntu 最新版本上运行作业 | ||
steps: | ||
- name: Checkout code # 使用 actions/checkout 检出当前代码 | ||
uses: actions/checkout@v4 | ||
- name: Set up Node.js # 设置 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 # 添加access token到.npmrc | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.ART }}" >> ./.npmrc | ||
ls -al | ||
cat ./.npmrc | ||
- name: Publish to npm # 发布到 npm registry | ||
run: npm publish | ||
env: | ||
NPM_TOKEN: ${{ secrets.ART }} # 读取github的secrets变量,这里的NPM_TOKEN是前面设置的变量名 |