Skip to content

assemble

assemble #6

name: Get Figma Images
on:
push:
# branches:
# - main
jobs:
findNodeReferences:
runs-on: ubuntu-latest
env:
FilesToScan: '**/*.mdx'
ImageUrlFile: figmaImageNodeUrls.json
ImageOutputDir: public/figmaImages
FigmaToken: ${{ secrets.FIGMA_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Get Figma Images
run: node scripts/getFigmaImages.js $FilesToScan > $ImageUrlFile
- name: Log file content
run: cat $ImageUrlFile
- name: Download images from figma
run: npx @primer/figma-images --figmaToken $FigmaToken --nodeURLsFile $ImageUrlFile --outputDir $ImageOutputDir
- name: Log output dir content
run: ls $ImageOutputDir
- name: Add images to repo
run: |
git config --global user.name 'Figma Images Action'
git config --global user.email '[email protected]'
git add -A $ImageOutputDir
git commit -a "Update Figma images"
git push