-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (61 loc) · 3.44 KB
/
import-figma.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
68
69
70
71
72
73
74
name: Import Figma variables
on:
workflow_dispatch:
jobs:
import:
name: Import Figma variables
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- name: 📦 Install dependencies
run: pnpm install
- name: 🛠️ Build Figma utils
run: pnpm run build
working-directory: packages/figma-utils
# we need to separately import the themes because they are all needed in different formats and selectors
- name: 🎨 Import onyx variables
run: |
pnpm run @sit-onyx/figma-utils import-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "../sit-onyx/src/styles/variables/themes" -m onyx -f CSS -s ":where(:root), .onyx-theme-default"
working-directory: packages/figma-utils
- name: 🎨 Import additional onyx themes
run: |
pnpm run @sit-onyx/figma-utils import-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "../sit-onyx/src/styles/variables/themes" -m lidl kaufland twogo -f CSS -s ":where(:root), .onyx-theme-{mode}"
working-directory: packages/figma-utils
- name: ☀️ Import light variables
run: |
pnpm run @sit-onyx/figma-utils import-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "../sit-onyx/src/styles/variables" -m light -s ":where(:root)"
working-directory: packages/figma-utils
- name: 🌙 Import dark variables
run: |
pnpm run @sit-onyx/figma-utils import-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "../sit-onyx/src/styles/variables" -m dark -s ":where(.dark)"
working-directory: packages/figma-utils
- name: 🛠️ Import spacing variables
run: |
pnpm run @sit-onyx/figma-utils import-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "../sit-onyx/src/styles/variables" -m spacing -s ":where(:root)"
working-directory: packages/figma-utils
- name: 🛠️ Import default density variables
run: |
pnpm run @sit-onyx/figma-utils import-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "../sit-onyx/src/styles/variables" -m default -s ":where(:root), :where(.onyx-density-{mode})" -n density-
working-directory: packages/figma-utils
- name: 🛠️ Import remaining densities
run: |
pnpm run @sit-onyx/figma-utils import-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "../sit-onyx/src/styles/variables" -m compact cozy -s ":where(.onyx-density-{mode})" -n density-
working-directory: packages/figma-utils
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
commit-message: "feat: update Figma variables"
title: "feat: update Figma variables"
body: |
This is an auto-generated pull request.
All variables have been updated from the [Figma file](https://www.figma.com/design/${{ vars.FIGMA_FILE_KEY }}).
branch-suffix: short-commit-hash # needed to not override other pull requests created via workflows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.ref_name }}