build icon via webhook #42
Workflow file for this run
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
name: build icon via webhook | |
on: | |
workflow_dispatch: | |
inputs: | |
modified_components: | |
description: 'JSON array for modified components' | |
required: true | |
default: '["ALL"]' | |
jobs: | |
build_icons: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: restore lerna | |
uses: actions/cache@v3 | |
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 }} | |
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@v5 | |
with: | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
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 |