Sync #758
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 | |
on: | |
schedule: | |
- cron: 0 0 * * * | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
token: ${{ secrets.PAT }} | |
repository: privy-open-source/design-system | |
- name: Get Cache Dir | |
id: yarn-cache-dir | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- name: Use Cache | |
uses: actions/cache@v4 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: "yarn" | |
- name: Install Deps | |
run: yarn install --immutable | |
- name: Run Sync Icon | |
run: yarn icon:sync | |
env: | |
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }} | |
FIGMA_FILE_ID: ${{ secrets.FIGMA_FILE_ID }} | |
- name: Run Sync Ilustration | |
run: yarn ilustration:sync | |
env: | |
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }} | |
FIGMA_FILE_ID: ${{ secrets.FIGMA_FILE_ID_ILUSTRATION }} | |
- name: Generate Changelog | |
id: changelog | |
run: | | |
echo 'icon_changelog<<EOF' >> $GITHUB_OUTPUT | |
yarn run icon:changelog >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
echo 'ilustration_changelog<<EOF' >> $GITHUB_OUTPUT | |
yarn run ilustration:changelog >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.PAT }} | |
branch: feat/sync-icon | |
commit-message: "chore: sync with figma" | |
title: "chore: sync with figma" | |
body: | | |
# Changelog | |
## Icon | |
${{ steps.changelog.outputs.icon_changelog }} | |
## Ilustration | |
${{ steps.changelog.outputs.ilustration_changelog }} |