Skip to content

Commit

Permalink
update pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrickert committed Jul 23, 2024
1 parent 3751390 commit f90e893
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 16 deletions.
49 changes: 33 additions & 16 deletions .github/workflows/import-figma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,42 @@ jobs:
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/themes" -m onyx -f CSS JSON -s ":where(:root), .onyx-theme-default"
working-directory: packages/figma-utils
- uses: ./.github/workflows/template-import-figma-variables.yml
name: Import onyx variables
with:
modes: onyx
selector: ":where(:root), .onyx-theme-default"
format: CSS JSON
output-directory: "../sit-onyx/src/styles/themes"

- 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/themes" -m lidl kaufland twogo -f CSS -s ":where(:root), .onyx-theme-{mode}"
working-directory: packages/figma-utils
- uses: ./.github/workflows/template-import-figma-variables.yml
name: Import additional onyx themes
with:
modes: lidl kaufland twogo
selector: ":where(:root), .onyx-theme-{mode}"
output-directory: "../sit-onyx/src/styles/themes"

- 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" -m light -s ":where(:root)"
working-directory: packages/figma-utils
- uses: ./.github/workflows/template-import-figma-variables.yml
name: Import light variables
with:
modes: light
selector: ":where(:root)"
output-directory: "../sit-onyx/src/styles"

- 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" -m dark -s ":where(.dark)"
working-directory: packages/figma-utils
- uses: ./.github/workflows/template-import-figma-variables.yml
name: Import light variables
with:
modes: dark
selector: ":where(.dark)"
output-directory: "../sit-onyx/src/styles"

- uses: ./.github/workflows/template-import-figma-variables.yml
name: Import density variables
with:
modes: compact default cozy
selector: ":where(.onyx-density-{mode})"
output-directory: "../sit-onyx/src/styles"
file-prefix: density-

- name: Create pull request
uses: peter-evans/create-pull-request@v6
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/template-import-figma-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Reusable workflow for importing Figma variables

on:
workflow_call:
inputs:
modes:
type: string
required: true
selector:
type: string
required: true
output-directory:
type: string
required: true
format:
type: string
default: CSS
file-prefix:
type: string
default: ""

jobs:
triage:
runs-on: ubuntu-latest
steps:
- run: |
pnpm run @sit-onyx/figma-utils import-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "${{ inputs.output-directory }}" -m ${{ inputs.modes }} -f ${{ inputs.format }} -s "${{ inputs.selector }}" -n "${{ inputs.file-prefix }}"
working-directory: packages/figma-utils

0 comments on commit f90e893

Please sign in to comment.