2023-01-02 14:13:45 -05:00
|
|
|
|
name: UI Components
|
|
|
|
|
|
|
|
|
|
on:
|
2023-01-02 17:05:09 -05:00
|
|
|
|
workflow_dispatch:
|
2023-01-02 14:13:45 -05:00
|
|
|
|
pull_request:
|
|
|
|
|
paths:
|
|
|
|
|
- .github/workflows/ui-components.yml
|
|
|
|
|
- 'packages/ui-components/**'
|
|
|
|
|
- 'package.json'
|
|
|
|
|
- 'pnpm-workspace.yaml'
|
|
|
|
|
- 'pnpm-lock.yaml'
|
|
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
|
|
2023-01-08 05:27:37 -05:00
|
|
|
|
env:
|
|
|
|
|
DEBUG: verdaccio*
|
|
|
|
|
|
2023-01-02 14:13:45 -05:00
|
|
|
|
jobs:
|
|
|
|
|
deploy:
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
|
deployments: write
|
|
|
|
|
pull-requests: write # to comment on pull-requests
|
|
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
env:
|
|
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
|
|
|
steps:
|
2023-06-11 20:36:44 -05:00
|
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2023-01-02 14:13:45 -05:00
|
|
|
|
|
|
|
|
|
- name: Use Node
|
2023-01-18 13:35:18 -05:00
|
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag=v3
|
2023-01-02 14:13:45 -05:00
|
|
|
|
with:
|
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
|
|
|
|
|
|
- name: Cache pnpm modules
|
2023-03-16 01:31:06 -05:00
|
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # 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-04-12 01:23:01 -05:00
|
|
|
|
corepack prepare --activate pnpm@latest-8
|
2023-01-02 14:13:45 -05:00
|
|
|
|
- name: Install
|
2023-04-12 01:23:01 -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
|
|
|
|
|
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 }}
|
|
|
|
|
build-dir: './packages/ui-components/storybook-static'
|
|
|
|
|
- name: 🤖 Deploy Preview UI Components Netlify
|
|
|
|
|
if: github.repository == 'verdaccio/verdaccio'
|
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
|
|
|
|
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'
|