Skip to content

Commit

Permalink
chore: ci scripts & rename docs dir (#1203)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Jul 22, 2024
1 parent 932bb8c commit eb947e8
Show file tree
Hide file tree
Showing 1,939 changed files with 34,101 additions and 32,697 deletions.
90 changes: 20 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,99 +12,49 @@ jobs:
name: Run svelte-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v3
with:
node-version: 18

# PNPM Store cache setup
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Run svelte-check
run: pnpm check

lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Node.JS
uses: actions/setup-node@v3
- uses: actions/checkout@v4
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
version: 8
node-version: 20
cache: pnpm

# PNPM Store cache setup
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- run: pnpm lint

cli-test:
name: CLI-Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18

# PNPM Store cache setup
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install
Expand Down
29 changes: 6 additions & 23 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: Docs - Preview Deployment
on:
pull_request_target:
paths:
- apps/www/**
- sites/docs/**

# cancel in-progress runs on new commits to same PR (github.event.number)
concurrency:
Expand All @@ -33,29 +33,12 @@ jobs:
runs-on: ubuntu-latest
name: Deploy Preview to Cloudflare Pages
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20

# PNPM Store cache setup
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
cache: pnpm

# Image cache setup
- name: Setup Image cache
Expand All @@ -79,5 +62,5 @@ jobs:
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: shadcn-svelte
directory: ./.svelte-kit/cloudflare
workingDirectory: apps/www
workingDirectory: sites/docs
deploymentName: Preview
28 changes: 7 additions & 21 deletions .github/workflows/docs-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
paths:
- apps/www/**
- sites/docs/**

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand All @@ -16,34 +16,20 @@ jobs:
deployments: write
name: Publish to Cloudflare Pages
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20

# PNPM Store cache setup
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
cache: pnpm

# Image cache setup
- name: Setup Image cache
uses: actions/cache@v3
with:
path: '**/node_modules/.cache/imagetools'
key: ${{ runner.os }}-image-cache-${{ hashFiles('**/src/lib/img') }}

- name: Install dependencies
run: pnpm install

Expand All @@ -58,5 +44,5 @@ jobs:
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: shadcn-svelte
directory: ./.svelte-kit/cloudflare
workingDirectory: apps/www
workingDirectory: sites/docs
deploymentName: Production
30 changes: 5 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,14 @@ jobs:
if: github.repository == 'huntabyte/shadcn-svelte'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use PNPM v8
uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node v18
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

# PNPM Store cache setup
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.16.0
v20.15.1
8 changes: 4 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CHANGELOG.md


# docs site specific
apps/www/src/__registry__/*
apps/www/other/themes/dark.json
apps/www/other/themes/light.json
apps/www/static
sites/docs/src/__registry__/*
sites/docs/other/themes/dark.json
sites/docs/other/themes/light.json
sites/docs/static
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
}
}
],
"tailwindConfig": "./apps/www/tailwind.config.js",
"tailwindFunctions": ["clsx", "cn", "tv"]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img align="center" src="https://raw.githubusercontent.com/huntabyte/shadcn-svelte/main/apps/www/static/android-chrome-192x192.png" height="96" />
<img align="center" src="https://raw.githubusercontent.com/huntabyte/shadcn-svelte/main/sites/docs/static/android-chrome-192x192.png" height="96" />
<h1 align="center">
shadcn-svelte
</h1>
Expand All @@ -13,7 +13,7 @@
Accessible and customizable components that you can copy and paste into your apps. Free. Open Source. **Use this to build your own component library**.

![hero](apps/www/static/og.png)
![hero](sites/docs/static/og.png)

## Documentation

Expand Down
Loading

0 comments on commit eb947e8

Please sign in to comment.