forked from hallee9000/juuust-react-icon
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 1.68 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: icon-automation
on:
push:
branches:
- master
# 如果需要,可以取消注释以下行来限制触发条件
# paths:
# - package.json
jobs:
icon_automation:
name: figma icon automation
runs-on: ubuntu-latest
env:
FIGMA_FILE_URL: ${{ secrets.FIGMA_FILE_URL }}
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x' # 更新到最新的 LTS Node.js 版本
- name: Debug - Check Environment Variables
run: |
echo "FIGMA_FILE_URL is set: ${{ secrets.FIGMA_FILE_URL }}"
echo "FIGMA_TOKEN is set: ${{ secrets.FIGMA_TOKEN }}"
- name: Configure Yarn
run: yarn config set "strict-ssl" false
- name: Install dependencies
run: yarn install
- name: Figma Action
uses: primer/[email protected]
with:
args: "format=svg outputDir=./src/"
env:
# FIGMA_FILE_URL: ${{ secrets.FIGMA_FILE_URL }}
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
- name: Generate files
run: yarn generate
- name: Build bundle
run: yarn build:bundle
- name: Setup NPM authentication
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
- name: Publish to NPM
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Build project
run: yarn build
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
with:
build_dir: docs
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}