Skip to content

Commit

Permalink
improve ci
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Mar 8, 2024
1 parent 1f6ea79 commit 2b4cba7
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 98 deletions.
100 changes: 50 additions & 50 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,62 +15,62 @@

name: Docs - Preview Deployment
on:
pull_request_target:
paths:
- apps/www/**
pull_request_target:
paths:
- apps/www/**

# cancel in-progress runs on new commits to same PR (github.event.number)
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
deploy-preview:
permissions:
contents: read
pull-requests: write
deployments: write
runs-on: ubuntu-latest
name: Deploy Preview to Cloudflare Pages (admin)
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
with:
node-version: 20
deploy-preview:
permissions:
contents: read
pull-requests: write
deployments: write
runs-on: ubuntu-latest
name: Deploy Preview to Cloudflare Pages (admin)
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
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-
# 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
- name: Install dependencies
run: pnpm --filter www install

- name: Build site
run: pnpm build
- name: Build site
run: pnpm build

- name: Deploy to Cloudflare Pages
id: cloudflare-pages-deploy
uses: AdrianGonz97/refined-cf-pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: shadcn-svelte
directory: ./.svelte-kit/cloudflare
workingDirectory: apps/www
deploymentName: Preview
- name: Deploy to Cloudflare Pages
id: cloudflare-pages-deploy
uses: AdrianGonz97/refined-cf-pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: shadcn-svelte
directory: ./.svelte-kit/cloudflare
workingDirectory: apps/www
deploymentName: Preview
90 changes: 45 additions & 45 deletions .github/workflows/docs-production.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
name: Docs Production Deployment
on:
push:
branches:
- main
paths:
- apps/www/**
push:
branches:
- main
paths:
- apps/www/**

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

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
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
with:
node-version: 20
publish:
runs-on: ubuntu-latest
permissions:
contents: read
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
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-
# 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
- name: Install dependencies
run: pnpm --filter www install

- name: Build site
run: pnpm build
- name: Build site
run: pnpm build

- name: Deploy to Cloudflare Pages
uses: AdrianGonz97/refined-cf-pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: shadcn-svelte
directory: ./.svelte-kit/cloudflare
workingDirectory: apps/www
deploymentName: Production
- name: Deploy to Cloudflare Pages
uses: AdrianGonz97/refined-cf-pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: shadcn-svelte
directory: ./.svelte-kit/cloudflare
workingDirectory: apps/www
deploymentName: Production
2 changes: 1 addition & 1 deletion apps/www/static/registry/styles/default/carousel.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
{
"name": "context.ts",
"content": "import type { EmblaCarouselSvelteType } from \"embla-carousel-svelte\";\nimport type emblaCarouselSvelte from \"embla-carousel-svelte\";\nimport { getContext, hasContext, setContext } from \"svelte\";\nimport type { HTMLAttributes } from \"svelte/elements\";\nimport type { Writable, Readable } from \"svelte/store\";\n\nexport type CarouselAPI = NonNullable<\n\tNonNullable<EmblaCarouselSvelteType[\"$$_attributes\"]>[\"on:emblaInit\"]\n> extends (evt: CustomEvent<infer CarouselAPI>) => void\n\t? CarouselAPI\n\t: never;\n\ntype EmblaCarouselConfig = NonNullable<Parameters<typeof emblaCarouselSvelte>[1]>;\n\nexport type CarouselOptions = EmblaCarouselConfig[\"options\"];\nexport type CarouselPlugins = EmblaCarouselConfig[\"plugins\"];\n\n////\n\nexport type CarouselProps = {\n\topts?: CarouselOptions;\n\tplugins?: CarouselPlugins;\n\tapi?: CarouselAPI;\n\torientation?: \"horizontal\" | \"vertical\";\n} & HTMLAttributes<HTMLDivElement>;\n\nconst EMBLA_CAROUSEL_CONTEXT = Symbol(\"EMBLA_CAROUSEL_CONTEXT\");\n\ntype EmblaContext = {\n\tapi: Writable<CarouselAPI | undefined>;\n\torientation: Writable<\"horizontal\" | \"vertical\">;\n\tscrollNext: () => void;\n\tscrollPrev: () => void;\n\tcanScrollNext: Readable<boolean>;\n\tcanScrollPrev: Readable<boolean>;\n\thandleKeyDown: (e: KeyboardEvent) => void;\n\toptions: Writable<CarouselOptions>;\n\tplugins: Writable<CarouselPlugins>;\n\tonInit: (e: CustomEvent<CarouselAPI>) => void;\n};\n\nexport function setEmblaContex(config: EmblaContext): EmblaContext {\n\tsetContext(EMBLA_CAROUSEL_CONTEXT, config);\n\treturn config;\n}\n\nexport function getEmblaContext(name = \"This component\") {\n\tif (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {\n\t\tthrow new Error(`${name} must be used within a <Carousel.Root> component`);\n\t}\n\treturn getContext<ReturnType<typeof setEmblaContex>>(EMBLA_CAROUSEL_CONTEXT);\n}\n"
"content": "import type { EmblaCarouselSvelteType } from \"embla-carousel-svelte\";\nimport type emblaCarouselSvelte from \"embla-carousel-svelte\";\nimport { getContext, hasContext, setContext } from \"svelte\";\nimport type { HTMLAttributes } from \"svelte/elements\";\nimport type { Writable, Readable } from \"svelte/store\";\n\nexport type CarouselAPI =\n\tNonNullable<NonNullable<EmblaCarouselSvelteType[\"$$_attributes\"]>[\"on:emblaInit\"]> extends (\n\t\tevt: CustomEvent<infer CarouselAPI>\n\t) => void\n\t\t? CarouselAPI\n\t\t: never;\n\ntype EmblaCarouselConfig = NonNullable<Parameters<typeof emblaCarouselSvelte>[1]>;\n\nexport type CarouselOptions = EmblaCarouselConfig[\"options\"];\nexport type CarouselPlugins = EmblaCarouselConfig[\"plugins\"];\n\n////\n\nexport type CarouselProps = {\n\topts?: CarouselOptions;\n\tplugins?: CarouselPlugins;\n\tapi?: CarouselAPI;\n\torientation?: \"horizontal\" | \"vertical\";\n} & HTMLAttributes<HTMLDivElement>;\n\nconst EMBLA_CAROUSEL_CONTEXT = Symbol(\"EMBLA_CAROUSEL_CONTEXT\");\n\ntype EmblaContext = {\n\tapi: Writable<CarouselAPI | undefined>;\n\torientation: Writable<\"horizontal\" | \"vertical\">;\n\tscrollNext: () => void;\n\tscrollPrev: () => void;\n\tcanScrollNext: Readable<boolean>;\n\tcanScrollPrev: Readable<boolean>;\n\thandleKeyDown: (e: KeyboardEvent) => void;\n\toptions: Writable<CarouselOptions>;\n\tplugins: Writable<CarouselPlugins>;\n\tonInit: (e: CustomEvent<CarouselAPI>) => void;\n};\n\nexport function setEmblaContex(config: EmblaContext): EmblaContext {\n\tsetContext(EMBLA_CAROUSEL_CONTEXT, config);\n\treturn config;\n}\n\nexport function getEmblaContext(name = \"This component\") {\n\tif (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {\n\t\tthrow new Error(`${name} must be used within a <Carousel.Root> component`);\n\t}\n\treturn getContext<ReturnType<typeof setEmblaContex>>(EMBLA_CAROUSEL_CONTEXT);\n}\n"
},
{
"name": "index.ts",
Expand Down
2 changes: 1 addition & 1 deletion apps/www/static/registry/styles/new-york/carousel.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
{
"name": "context.ts",
"content": "import type { EmblaCarouselSvelteType } from \"embla-carousel-svelte\";\nimport type emblaCarouselSvelte from \"embla-carousel-svelte\";\nimport { getContext, hasContext, setContext } from \"svelte\";\nimport type { HTMLAttributes } from \"svelte/elements\";\nimport type { Writable, Readable } from \"svelte/store\";\n\nexport type CarouselAPI = NonNullable<\n\tNonNullable<EmblaCarouselSvelteType[\"$$_attributes\"]>[\"on:emblaInit\"]\n> extends (evt: CustomEvent<infer CarouselAPI>) => void\n\t? CarouselAPI\n\t: never;\n\ntype EmblaCarouselConfig = NonNullable<Parameters<typeof emblaCarouselSvelte>[1]>;\n\nexport type CarouselOptions = EmblaCarouselConfig[\"options\"];\nexport type CarouselPlugins = EmblaCarouselConfig[\"plugins\"];\n\n////\n\nexport type CarouselProps = {\n\topts?: CarouselOptions;\n\tplugins?: CarouselPlugins;\n\tapi?: CarouselAPI;\n\torientation?: \"horizontal\" | \"vertical\";\n} & HTMLAttributes<HTMLDivElement>;\n\nconst EMBLA_CAROUSEL_CONTEXT = Symbol(\"EMBLA_CAROUSEL_CONTEXT\");\n\ntype EmblaContext = {\n\tapi: Writable<CarouselAPI | undefined>;\n\torientation: Writable<\"horizontal\" | \"vertical\">;\n\tscrollNext: () => void;\n\tscrollPrev: () => void;\n\tcanScrollNext: Readable<boolean>;\n\tcanScrollPrev: Readable<boolean>;\n\thandleKeyDown: (e: KeyboardEvent) => void;\n\toptions: Writable<CarouselOptions>;\n\tplugins: Writable<CarouselPlugins>;\n\tonInit: (e: CustomEvent<CarouselAPI>) => void;\n};\n\nexport function setEmblaContex(config: EmblaContext): EmblaContext {\n\tsetContext(EMBLA_CAROUSEL_CONTEXT, config);\n\treturn config;\n}\n\nexport function getEmblaContext(name = \"This component\") {\n\tif (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {\n\t\tthrow new Error(`${name} must be used within a <Carousel.Root> component`);\n\t}\n\treturn getContext<ReturnType<typeof setEmblaContex>>(EMBLA_CAROUSEL_CONTEXT);\n}\n"
"content": "import type { EmblaCarouselSvelteType } from \"embla-carousel-svelte\";\nimport type emblaCarouselSvelte from \"embla-carousel-svelte\";\nimport { getContext, hasContext, setContext } from \"svelte\";\nimport type { HTMLAttributes } from \"svelte/elements\";\nimport type { Writable, Readable } from \"svelte/store\";\n\nexport type CarouselAPI =\n\tNonNullable<NonNullable<EmblaCarouselSvelteType[\"$$_attributes\"]>[\"on:emblaInit\"]> extends (\n\t\tevt: CustomEvent<infer CarouselAPI>\n\t) => void\n\t\t? CarouselAPI\n\t\t: never;\n\ntype EmblaCarouselConfig = NonNullable<Parameters<typeof emblaCarouselSvelte>[1]>;\n\nexport type CarouselOptions = EmblaCarouselConfig[\"options\"];\nexport type CarouselPlugins = EmblaCarouselConfig[\"plugins\"];\n\n////\n\nexport type CarouselProps = {\n\topts?: CarouselOptions;\n\tplugins?: CarouselPlugins;\n\tapi?: CarouselAPI;\n\torientation?: \"horizontal\" | \"vertical\";\n} & HTMLAttributes<HTMLDivElement>;\n\nconst EMBLA_CAROUSEL_CONTEXT = Symbol(\"EMBLA_CAROUSEL_CONTEXT\");\n\ntype EmblaContext = {\n\tapi: Writable<CarouselAPI | undefined>;\n\torientation: Writable<\"horizontal\" | \"vertical\">;\n\tscrollNext: () => void;\n\tscrollPrev: () => void;\n\tcanScrollNext: Readable<boolean>;\n\tcanScrollPrev: Readable<boolean>;\n\thandleKeyDown: (e: KeyboardEvent) => void;\n\toptions: Writable<CarouselOptions>;\n\tplugins: Writable<CarouselPlugins>;\n\tonInit: (e: CustomEvent<CarouselAPI>) => void;\n};\n\nexport function setEmblaContex(config: EmblaContext): EmblaContext {\n\tsetContext(EMBLA_CAROUSEL_CONTEXT, config);\n\treturn config;\n}\n\nexport function getEmblaContext(name = \"This component\") {\n\tif (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {\n\t\tthrow new Error(`${name} must be used within a <Carousel.Root> component`);\n\t}\n\treturn getContext<ReturnType<typeof setEmblaContex>>(EMBLA_CAROUSEL_CONTEXT);\n}\n"
},
{
"name": "index.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"check": "pnpm --filter www check",
"check:watch": "pnpm --filter www check:watch",
"test:unit": "pnpm --filter www test:unit",
"lint": "pnpm -r lint",
"lint": "pnpm --filter www --filter shadcn-svelte lint",
"format:check": "pnpm -r format:check",
"format": "pnpm -r format",
"preinstall": "npx only-allow pnpm",
Expand Down

0 comments on commit 2b4cba7

Please sign in to comment.