2023-01-02 14:13:45 -05:00
|
|
|
|
name: UI Components
|
|
|
|
|
|
2023-10-23 14:55:27 -05:00
|
|
|
|
on:
|
2024-01-22 02:11:54 -05:00
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
2023-01-02 14:13:45 -05:00
|
|
|
|
permissions:
|
2023-10-23 14:55:27 -05:00
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
2023-01-02 14:13:45 -05:00
|
|
|
|
|
2023-01-08 05:27:37 -05:00
|
|
|
|
env:
|
|
|
|
|
DEBUG: verdaccio*
|
|
|
|
|
|
2023-01-02 14:13:45 -05:00
|
|
|
|
jobs:
|
|
|
|
|
deploy:
|
|
|
|
|
permissions:
|
2023-10-23 14:55:27 -05:00
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
2023-01-02 14:13:45 -05:00
|
|
|
|
deployments: write
|
2023-10-23 14:55:27 -05:00
|
|
|
|
pull-requests: write # to comment on pull-requests
|
2023-01-02 14:13:45 -05:00
|
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
env:
|
|
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
|
|
|
steps:
|
2023-10-10 11:24:51 -05:00
|
|
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
|
2023-01-02 14:13:45 -05:00
|
|
|
|
|
|
|
|
|
- name: Use Node
|
2023-12-18 15:38:06 -05:00
|
|
|
|
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3
|
2023-01-02 14:13:45 -05:00
|
|
|
|
with:
|
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
|
|
|
|
|
|
- name: Cache pnpm modules
|
2024-01-14 07:10:27 -05:00
|
|
|
|
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
2023-01-02 14:13:45 -05:00
|
|
|
|
env:
|
|
|
|
|
cache-name: cache-pnpm-modules
|
|
|
|
|
with:
|
|
|
|
|
path: ~/.pnpm-store
|
|
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
|
restore-keys: |
|
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
|
|
|
|
|
|
|
|
|
|
- name: Install pnpm
|
|
|
|
|
run: |
|
|
|
|
|
corepack enable
|
2023-10-23 14:55:27 -05:00
|
|
|
|
corepack prepare --activate pnpm@8.9.0
|
2023-01-02 14:13:45 -05:00
|
|
|
|
- name: Install
|
2023-10-23 14:55:27 -05:00
|
|
|
|
run: pnpm install
|
2023-01-02 14:13:45 -05:00
|
|
|
|
- name: Build storybook
|
|
|
|
|
run: pnpm ui:storybook:build
|
|
|
|
|
- name: Copy public content
|
|
|
|
|
# the msw.js worker is need it at the storybook-static folder in production
|
|
|
|
|
run: cp -R packages/ui-components/public/* packages/ui-components/storybook-static
|
|
|
|
|
- name: 🔥 Deploy Production UI Netlify
|
2023-10-23 14:55:27 -05:00
|
|
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
2023-04-10 01:09:05 -05:00
|
|
|
|
uses: verdaccio/action-netlify-deploy@1c086d59169edeec9254672c7de17d2ceac3928f # v2.0.0
|
2023-01-02 14:13:45 -05:00
|
|
|
|
with:
|
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
|
|
|
netlify-site-id: ${{ secrets.NETLIFY_UI_SITE_ID }}
|
2023-10-23 14:55:27 -05:00
|
|
|
|
build-dir: './packages/ui-components/storybook-static'
|
2023-01-02 14:13:45 -05:00
|
|
|
|
- name: 🤖 Deploy Preview UI Components Netlify
|
|
|
|
|
if: github.repository == 'verdaccio/verdaccio'
|
2023-07-07 01:04:23 -05:00
|
|
|
|
uses: semoal/action-netlify-deploy@1a53f098745bf78555d11b436f5ee3af87e6b566
|
2023-01-02 14:13:45 -05:00
|
|
|
|
id: netlify_preview_ui
|
|
|
|
|
with:
|
|
|
|
|
draft: true
|
|
|
|
|
comment-on-pull-request: true
|
|
|
|
|
github-deployment-is-production: false
|
|
|
|
|
github-deployment-is-transient: true
|
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
|
|
|
netlify-site-id: ${{ secrets.NETLIFY_UI_SITE_ID }}
|
|
|
|
|
build-dir: './packages/ui-components/storybook-static'
|