Created
July 3, 2021 15:32
-
-
Save chasemccoy/c179e294072d0dd17692cf1b360dc212 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync icons from Figma | |
on: | |
schedule: | |
# Every 30 minutes | |
- cron: '*/30 * * * *' | |
jobs: | |
all: | |
name: Sync icons | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: 'main' | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '10.x' | |
# Persist the yarn cache between builds, unless yarn.lock changes | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Dependencies | |
run: yarn install | |
- uses: chasemccoy/[email protected] | |
with: | |
args: "format=svg outputDir=./figma" | |
env: | |
# This points to the Figma URL of our current icon kit | |
FIGMA_FILE_URL: "https://www.figma.com/file/foo" | |
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }} | |
# Move the output files to our icons folder and run the icon linter on them | |
- run: | | |
sudo cp -R ./figma/svg/. ./icons/ | |
sudo rm -r ./figma | |
sudo yarn icon-lint write "./icons/*.svg" | |
# Create a PR if there are any file diffs | |
- uses: peter-evans/create-pull-request@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "chore: sync icons with Figma" | |
title: "Sync icons from Figma" | |
branch: "figma-icon-sync" | |
base: "main" | |
body: | | |
🚨 **This pull request has been created automatically** 🚨 | |
Racine uses a GitHub action to sync the svg files for our icons from our [master icon kit in Figma](https://www.figma.com/file/JntSzB4AsESVN736De2PUc/Sprout-Icons). This script runs every 30 minutes. | |
Whenever you need to release any icon changes into Racine, you can merge this PR and publish a new version of the package. | |
**Be sure to take a look at the changes files to make sure everything is in order before merging.** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment