Skip to content

Commit

Permalink
setting up style dictionary and github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
etnlbck committed Dec 21, 2024
1 parent 1af354a commit a6a35c0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/rebuild-tokens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Rebuild Tokens

on:
push:
branches:
- design-tokens

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: bun install

- name: Rebuild tokens
run: bun run build:tokens

- name: Commit and push token changes (if applicable)
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add .
git commit -m "Update tokens after rebuild" || echo "No changes to commit"
git push origin design-tokens
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dev": "turbo run dev",
"lint": "turbo run lint",
"clean": "turbo run clean && rm -rf node_modules",
"build:tokens": "style-dictionary build --config=./tokens/config.json",
"build:tokens": "style-dictionary build --config=./packages/tokens/config.json",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"changeset": "changeset",
"version-packages": "changeset version",
Expand Down
4 changes: 2 additions & 2 deletions packages/tokens/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"platforms": {
"web": {
"transformGroup": "css",
"buildPath": "build/web/",
"buildPath": "packages/ui/dist/",
"files": [
{
"destination": "packages/ui/dist/foundation/variables.css",
"destination": "foundation/variables.css",
"format": "css/variables"
}
]
Expand Down

0 comments on commit a6a35c0

Please sign in to comment.