Skip to content

Figma Publish

Figma Publish #50

Workflow file for this run

name: Figma Publish
on:
repository_dispatch:
types: [library_publish]
workflow_dispatch:
inputs:
commit_type:
description: 'Commit Type'
required: true
default: 'refactor'
type: choice
options:
- feat
- fix
- refactor
commit_message:
description: 'Commit Type'
required: true
default: 'update icons'
type: string
concurrency: publish
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
scope: sbb-esta
- name: Yarn Install
uses: ./.github/actions/yarn-install
- name: 'Release: Set git user'
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Extract icons
run: yarn extract
env:
FIGMA_FILE_ID: ${{ secrets.FIGMA_FILE_ID }}
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes
run: |
if [ -z "${{ inputs.commit_type }}" ]
then
MESSAGE="${{ github.event.client_payload.description }}"
else
MESSAGE="${{ inputs.commit_type }}: ${{ inputs.commit_message }}"
fi
git add --all
git commit -m "$MESSAGE"
- name: Ensure latest branch state
run: git pull --rebase
- name: Release
uses: ./.github/actions/release
with:
npm-token: ${{ secrets.NPM_TOKEN }}
aws-access-key-id: ${{ secrets.ICON_CDN_AWS_ACCESS_ID }}
aws-secret-access-key: ${{ secrets.ICON_CDN_AWS_ACCESS_KEY }}