-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (62 loc) · 1.86 KB
/
figma-publish.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
68
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 }}
github-token: ${{ secrets.DISPATCH_TOKEN }}