update workflows #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow builds and publishes the shadcn registry to GitHub Pages when main branch is updated | |
| name: Publish Registry | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| publish: | |
| environment: github-pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Registry | |
| run: | | |
| # Build registry components | |
| pnpm registry:build | |
| # Create output directory for registry | |
| mkdir -p registry-static | |
| # Copy registry files to output | |
| cp -r public/r registry-static/r | |
| # Add .nojekyll to serve files starting with underscore | |
| touch registry-static/.nojekyll | |
| # Create a simple registry index page with links to all components | |
| cat > registry-static/r/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Astrify UI - shadcn Registry</title> | |
| <style> | |
| body { font-family: system-ui, -apple-system, sans-serif; padding: 2rem; max-width: 800px; margin: 0 auto; line-height: 1.6; } | |
| h1 { color: #333; margin-bottom: 0.5rem; } | |
| h2 { color: #555; margin-top: 2rem; } | |
| .subtitle { color: #666; margin-bottom: 2rem; } | |
| .component-list { list-style: none; padding: 0; } | |
| .component-list li { margin: 1rem 0; padding: 1rem; background: #f9f9f9; border-radius: 6px; } | |
| .component-list a { color: #0066cc; text-decoration: none; font-weight: 500; font-size: 1.1rem; } | |
| .component-list a:hover { text-decoration: underline; } | |
| .component-desc { color: #666; margin-top: 0.25rem; font-size: 0.9rem; } | |
| pre { background: #f5f5f5; padding: 1rem; border-radius: 4px; overflow-x: auto; } | |
| .info { background: #e3f2fd; padding: 1rem; border-radius: 6px; margin: 1rem 0; border-left: 4px solid #2196f3; } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Astrify UI - shadcn Registry</h1> | |
| <p class="subtitle">Full-stack modules for Laravel, Inertia, and React. Production-ready components with pre-wired backends.</p> | |
| <div class="info"> | |
| <strong>Registry URL:</strong> <code>https://astrify.com/r/</code><br> | |
| <strong>Docs:</strong> <a href="https://astrify.com">astrify.com</a> | |
| </div> | |
| <h2>Available Modules:</h2> | |
| <ul class="component-list"> | |
| <li> | |
| <a href="upload.json">upload.json</a> | |
| <div class="component-desc">Complete file upload module with S3 storage, signed URLs, and Laravel backend</div> | |
| </li> | |
| <li> | |
| <a href="paginated-table.json">paginated-table.json</a> | |
| <div class="component-desc">Table component with built-in pagination for numeric and simple pagination styles</div> | |
| </li> | |
| <li> | |
| <a href="json-table.json">json-table.json</a> | |
| <div class="component-desc">Table component that fetches and displays paginated JSON data from API endpoints</div> | |
| </li> | |
| </ul> | |
| <h2>Installation:</h2> | |
| <p>Install any module using the shadcn CLI:</p> | |
| <pre><code>npx shadcn@latest add https://astrify.com/r/upload.json</code></pre> | |
| <p>Or use the GitHub Pages URL directly:</p> | |
| <pre><code>npx shadcn@latest add https://astrify.github.io/ui/r/paginated-table.json</code></pre> | |
| <h2>Documentation:</h2> | |
| <p>For detailed installation instructions, usage examples, and API reference, visit <a href="https://astrify.com">astrify.com</a>.</p> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ./registry-static | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |