-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (52 loc) · 1.95 KB
/
build-icon.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
name: build icon via webhook
on:
workflow_dispatch:
inputs:
modified_components:
description: 'JSON array for modified components'
required: true
default: '["ALL"]'
permissions:
contents: write
pull-requests: write
jobs:
build_icons:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: restore lerna
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --frozen-lockfile
- name: Update Icons
env:
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
FIGMA_ACCESS_TOKEN: ${{ secrets.FIGMA_TOKEN_CODE_CONNECT }} # This is for Figma Code Connect in spindle-ui
FILE_KEY: ${{ secrets.FIGMA_ICON_FILE_KEY }}
NODE_ID: ${{ secrets.FIGMA_ICON_NODE_ID }}
ICON_NAMES: ${{ github.event.inputs.modified_components }}
run: |
node -p "JSON.stringify({ fileKey: '$FILE_KEY', nodeId: '$NODE_ID', dest: 'dist', iconNames: '$ICON_NAMES' })" > packages/spindle-icons/figma.json
yarn lerna run --scope @openameba/spindle-icons build
yarn lerna run --scope @openameba/spindle-ui icon
yarn fix
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit-message: 'feat(spindle-icons): update icons'
branch: feat/build-icon-via-webhook
delete-branch: true
title: 'feat(spindle-icons): update icons'
body: ${{ github.event.inputs.modified_components }}
labels: |
spindle-icons
spindle-ui