-
Notifications
You must be signed in to change notification settings - Fork 27
69 lines (57 loc) · 1.92 KB
/
figma-tokens-updater.yaml
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
68
69
# This workflow will raise a PR to the main branch when an update is done to the figma tokens.
name: 👮♀️ Figma Tokens Updater
on: pull_request
env:
PRIMITIVES_SOURCE: ./packages/primitives
jobs:
run_if:
if: ${{ github.head_ref == 'figma-tokens' }}
name: Process Figma Tokens
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: ⬇️ Checkout
id: checkout
uses: actions/checkout@master
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: 🥡 Setup pnpm
id: setup-pnpm
uses: pnpm/[email protected]
with:
version: latest
run_install: false
- name: 🎈 Get pnpm store directory
id: get-pnpm-cache-dir
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: 🔆 Cache pnpm modules
uses: actions/cache@v3
id: pnpm-cache
with:
path: ${{ steps.get-pnpm-cache-dir.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: 🧩 Install Dependencies
id: install-dependencies
run: pnpm install
- name: 👷 Build
id: build
run: pnpm build
- name: 🤖 Run Token Transformer
id: run-token-transformer
working-directory: ${{ env.PRIMITIVES_SOURCE }}
run: pnpm transform
- name: 🦎 Run Style Dictionary
id: run-style-dictionary
working-directory: ${{ env.PRIMITIVES_SOURCE }}
run: pnpm build
- name: 🐤 Commit changes
id: commit
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'chore(primitives): generate transformed tokens'
add: '.'