This repository was archived by the owner on Feb 20, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 2.42 KB
/
deploy.yml
File metadata and controls
67 lines (65 loc) · 2.42 KB
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
name: Deploy Component Library
on:
push:
branches: [main, staging]
workflow_dispatch:
jobs:
skip-release:
name: Skip Release
runs-on: ubuntu-20.04
outputs:
SKIP_RELEASE: ${{ steps.skip_release.outputs.SKIP_RELEASE }}
steps:
- name: Skip release
id: skip_release
run: |
SKIP_RELEASE=0
if grep -q '^v[0-9]' <<< "${{ github.event.head_commit.message }}" ; then
SKIP_RELEASE=1
elif github.event_name == 'pull_request' ; then
SKIP_RELEASE=1
elif ! grep -q 'staging\|main' <<< "${{ github.ref_name }}" ; then
SKIP_RELEASE=1
fi
echo SKIP_RELEASE: $SKIP_RELEASE
echo "::set-output name=SKIP_RELEASE::$SKIP_RELEASE"
deploy:
name: Styleguidist Deploy
runs-on: ubuntu-latest
needs: skip-release
if: needs.skip-release.outputs.SKIP_RELEASE == 0
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install packages
working-directory: ./packages/ui-kit
run: npm install
- name: Generate CSS Output
working-directory: ./packages/ui-kit
run: npx tailwindcss -i ./src/index.css -o ./dist/output.css
- name: Build the app w/styleguidist
working-directory: ./packages/ui-kit
run: ../../node_modules/.bin/styleguidist build --config styleguide.config.cjs
- name: Install Surge
working-directory: ./packages/ui-kit
run: npm install -g surge
- name: Get Deployment URL
id: get_deployment_url
run: |
DEPLOYMENT_URL=https://keyp-ui-library-dev.surge.sh
if ${{ github.ref_name }} == 'main' ; then
DEPLOYMENT_URL=https://keyp-ui-library.surge.sh
fi
echo DEPLOYMENT_URL: $DEPLOYMENT_URL
echo "::set-output name=DEPLOYMENT_URL::$DEPLOYMENT_URL"
- name: Deploy to surge
working-directory: ./packages/ui-kit
run: surge ./styleguide ${{steps.get_deployment_url.outputs.DEPLOYMENT_URL}} --token ${{secrets.SURGE_TOKEN}}
- name: Discord notify
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_RELEASE }}
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9
with:
args: 🚢 Shipped! `${{ github.repository }}` New surge deployment ${{steps.get_deployment_url.outputs.DEPLOYMENT_URL}}