-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (63 loc) · 1.88 KB
/
tokens-build.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
# Builds the tokens package to update the figma folder
name: 'Build Tokens Package'
on:
workflow_dispatch:
push:
paths: ['packages/tokens/**']
branches:
- main
jobs:
tokens-build:
id: tokens-build
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.VA_MOBILE_ROBOT_GITHUB_PAT }}
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- run: yarn install
- name: Build tokens
run: |
yarn tokens:build
- name: Prepare commit
working-directory: packages/tokens
run: |
git config --global user.name 'VA Automation Bot'
git config --global user.email '[email protected]'
git pull
git add -f figma/
- name: Check figma diff
id: diff
working-directory: packages/tokens
run: |
git commit --dry-run
- name: No changes to figma tokens
if: failure() || steps.diff.conclusion == 'failure'
run: |
echo No changes to figma tokens
- name: Commit latest figma tokens
if: success() && steps.diff.conclusion == 'success'
working-directory: packages/tokens
run: |
git commit -m 'Build latest figma tokens'
git push
tokens-build-success:
needs: tokens-build
runs-on: ubuntu-latest
steps:
- name: Tokens Build Succeeded
if: tokens-build.steps.diff.conclusion == 'success'
run: |
echo Great success!
- name: Tokens Build Failure
if: failure() || jobs.tokens-build.steps.diff.conclusion == 'failure'
run: exit 1