Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy Template CMS

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'apps/template-cms/package-lock.json'

- name: Install dependencies
working-directory: ./apps/template-cms
run: npm ci

- name: Type check
working-directory: ./apps/template-cms
run: npx nuxi typecheck

- name: Build project
working-directory: ./apps/template-cms
run: npm run build

- name: Test build output
working-directory: ./apps/template-cms
run: |
ls -la .output/
ls -la .output/server/

deploy:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'apps/template-cms/package-lock.json'

- name: Install dependencies
working-directory: ./apps/template-cms
run: npm ci

- name: Build for production
working-directory: ./apps/template-cms
run: npm run build

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./apps/template-cms
vercel-args: '--prod'
130 changes: 130 additions & 0 deletions .github/workflows/template-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: Process Template Submission

on:
repository_dispatch:
types: [template-submission]

jobs:
process-template:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Validate template data
run: |
echo "Template name: ${{ github.event.client_payload.name }}"
echo "Template category: ${{ github.event.client_payload.category }}"
echo "Template files: ${{ github.event.client_payload.files }}"

- name: Create template directory
run: |
mkdir -p "templates/${{ github.event.client_payload.name }}"

- name: Process template files
run: |
# This would decode base64 files and save them
echo "Processing template files..."
# Add actual file processing logic here

- name: Update bundles.json
run: |
# Update bundles.json with new template
python -c "
import json
import sys

try:
with open('templates/bundles.json', 'r') as f:
bundles = json.load(f)
except FileNotFoundError:
bundles = {}

category = '${{ github.event.client_payload.category }}'
template_name = '${{ github.event.client_payload.name }}'

if category not in bundles:
bundles[category] = []

if template_name not in bundles[category]:
bundles[category].append(template_name)

with open('templates/bundles.json', 'w') as f:
json.dump(bundles, f, indent=2)
"

- name: Update index.json
run: |
# Update index.json with template metadata
echo "Updating index.json..."
# Add actual index update logic here

- name: Bump version
run: |
# Bump version in pyproject.toml
python -c "
import re

try:
with open('pyproject.toml', 'r') as f:
content = f.read()

version_match = re.search(r'version\s*=\s*\"(\d+)\.(\d+)\.(\d+)\"', content)
if version_match:
major, minor, patch = map(int, version_match.groups())
new_version = f'{major}.{minor}.{patch + 1}'

new_content = re.sub(
r'version\s*=\s*\"\d+\.\d+\.\d+\"',
f'version = \"{new_version}\"',
content
)

with open('pyproject.toml', 'w') as f:
f.write(new_content)

print(f'Version bumped to {new_version}')
else:
print('No version found to bump')
except FileNotFoundError:
print('pyproject.toml not found')
"

- name: Commit and push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add template: ${{ github.event.client_payload.name }}

🤖 Generated with Template Manager

Co-Authored-By: Template Manager <[email protected]>" || exit 0
git push

- name: Create release
if: contains(github.event.client_payload.name, '_release')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Release v${{ steps.version.outputs.version }}
body: |
New template added: ${{ github.event.client_payload.name }}

Auto-generated release from template submission.
draft: false
prerelease: false
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,20 @@ LINK_CHECKER_REPORT.md

# Asset validation report (generated by scripts)
asset_validation_report.md

# TinaCMS
.tina/
tina/database.gql

# ComfyUI Template CMS build output
apps/template-cms/.output/
apps/template-cms/.nuxt/

# Don't duplicate template assets - use API instead
apps/template-cms/public/*.json
apps/template-cms/public/*.webp
apps/template-cms/public/*.mp3
apps/template-cms/public/*.mp4

# Old admin directory (replaced by apps/template-cms)
/admin/
10 changes: 10 additions & 0 deletions .tinaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
.git
.nx
dist
*.log
.venv
temp/
packages/
admin/
.tina/
Loading
Loading