Skip to content

Commit

Permalink
Add template metadata to package.json
Browse files Browse the repository at this point in the history
- Add Cloudflare-specific metadata to "cloudflare" section of package.json
- Add CI job for deploying templates to internal templates account from main branch
  • Loading branch information
maxwellpeterson committed Nov 20, 2024
1 parent 974ef3a commit 6a76128
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/branches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-checks
group: ${{ github.workflow }}-${{ github.ref }}-check
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Main

on:
push:
branches: ['main']

jobs:
check-and-deploy:
name: Check and Deploy
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency: templates-check-and-deploy
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- run: npm ci
- run: npm run check:ci
- run: npm run deploy
16 changes: 16 additions & 0 deletions d1-template/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
{
"name": "d1-template",
"description": "Cloudflare's native serverless SQL database.",
"cloudflare": {
"label": "Worker + D1 Database",
"products": [
"Workers",
"D1"
],
"categories": [
"storage"
],
"icon_urls": [
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/c6fc5da3-1e0a-4608-b2f1-9628577ec800/public",
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/5ca0ca32-e897-4699-d4c1-6b680512f000/public"
],
"docs_url": "https://developers.cloudflare.com/d1/"
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241112.0",
"typescript": "5.6.3",
Expand Down
14 changes: 14 additions & 0 deletions image-classification-template/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"name": "image-classification-template",
"description": "Identify and label objects found in images.",
"cloudflare": {
"label": "Image Classification App",
"products": [
"Workers",
"AI"
],
"categories": [
"ai"
],
"icon_urls": [
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/5ca0ca32-e897-4699-d4c1-6b680512f000/public"
]
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241112.0",
"typescript": "5.6.3",
Expand Down
14 changes: 14 additions & 0 deletions llm-template/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"name": "llm-template",
"description": "Perform natural language processing tasks using a Large Language Model (LLM) with Workers.",
"cloudflare": {
"label": "LLM App",
"products": [
"Workers",
"AI"
],
"categories": [
"ai"
],
"icon_urls": [
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/5ca0ca32-e897-4699-d4c1-6b680512f000/public"
]
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241112.0",
"typescript": "5.6.3",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"check:ci": "prettier . --check && syncpack lint && turbo run check types && git diff --exit-code",
"deploy": "turbo run deploy",
"fix:ci": "prettier . --write && syncpack fix-mismatches && turbo run types"
"fix:ci": "prettier . --write && syncpack format && syncpack fix-mismatches && turbo run types"
},
"workspaces": [
"./*-template"
Expand Down
14 changes: 14 additions & 0 deletions speech-to-text-template/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"name": "speech-to-text-template",
"description": "Convert audio to text with Whisper.",
"cloudflare": {
"label": "Speech to Text App",
"products": [
"Workers",
"AI"
],
"categories": [
"ai"
],
"icon_urls": [
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/5ca0ca32-e897-4699-d4c1-6b680512f000/public"
]
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241112.0",
"typescript": "5.6.3",
Expand Down
14 changes: 14 additions & 0 deletions text-classification-template/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"name": "text-classification-template",
"description": "Categorize unstructured text into groups based on criteria of your choice.",
"cloudflare": {
"label": "Text Classification App",
"products": [
"Workers",
"AI"
],
"categories": [
"ai"
],
"icon_urls": [
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/5ca0ca32-e897-4699-d4c1-6b680512f000/public"
]
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241112.0",
"typescript": "5.6.3",
Expand Down
14 changes: 14 additions & 0 deletions text-to-image-template/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"name": "text-to-image-template",
"description": "Generate images based on text prompts.",
"cloudflare": {
"label": "Text to Image App",
"products": [
"Workers",
"AI"
],
"categories": [
"ai"
],
"icon_urls": [
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/5ca0ca32-e897-4699-d4c1-6b680512f000/public"
]
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241112.0",
"typescript": "5.6.3",
Expand Down
14 changes: 14 additions & 0 deletions translation-template/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"name": "translation-template",
"description": "Translate text from one language to another.",
"cloudflare": {
"label": "Translation App",
"products": [
"Workers",
"AI"
],
"categories": [
"ai"
],
"icon_urls": [
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/5ca0ca32-e897-4699-d4c1-6b680512f000/public"
]
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241112.0",
"typescript": "5.6.3",
Expand Down
14 changes: 14 additions & 0 deletions vector-embedding-template/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"name": "vector-embedding-template",
"description": "Convert text into mathematical vectors so that you can perform text analysis and transformations.",
"cloudflare": {
"label": "Vector Embedding App",
"products": [
"Workers",
"AI"
],
"categories": [
"ai"
],
"icon_urls": [
"https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/5ca0ca32-e897-4699-d4c1-6b680512f000/public"
]
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241112.0",
"typescript": "5.6.3",
Expand Down

0 comments on commit 6a76128

Please sign in to comment.