Commit
Β·
025fed2
1
Parent(s):
297c500
update deploy script
Browse files- .github/workflows/deploy.yml +13 -21
- Dockerfile +0 -2
- README.md +3 -2
- components/category/CategoryCard.tsx +1 -1
.github/workflows/deploy.yml
CHANGED
|
@@ -9,33 +9,25 @@ on:
|
|
| 9 |
jobs:
|
| 10 |
build-and-deploy:
|
| 11 |
runs-on: ubuntu-latest
|
| 12 |
-
|
| 13 |
steps:
|
| 14 |
- name: Checkout repository
|
| 15 |
uses: actions/checkout@v3
|
| 16 |
|
| 17 |
-
- name: Set up
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
- name: Install dependencies
|
| 23 |
-
run: npm ci
|
| 24 |
|
| 25 |
-
- name:
|
| 26 |
-
run:
|
|
|
|
| 27 |
|
| 28 |
-
- name:
|
| 29 |
-
run:
|
|
|
|
|
|
|
| 30 |
|
| 31 |
- name: Push to Hugging Face Spaces
|
| 32 |
-
env:
|
| 33 |
-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 34 |
run: |
|
| 35 |
-
|
| 36 |
-
git init
|
| 37 |
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
| 38 |
-
git config user.name "github-actions[bot]"
|
| 39 |
-
git add .
|
| 40 |
-
git commit -m "Update build artifacts and README"
|
| 41 |
-
git push --force https://${{ secrets.HF_USERNAME }}:$HF_TOKEN@huggingface.co/spaces/${{ secrets.HF_USERNAME }}/${{ secrets.SPACE_NAME }} HEAD:main
|
|
|
|
| 9 |
jobs:
|
| 10 |
build-and-deploy:
|
| 11 |
runs-on: ubuntu-latest
|
| 12 |
+
|
| 13 |
steps:
|
| 14 |
- name: Checkout repository
|
| 15 |
uses: actions/checkout@v3
|
| 16 |
|
| 17 |
+
- name: Set up Git
|
| 18 |
+
run: |
|
| 19 |
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
| 20 |
+
git config user.name "github-actions[bot]"
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
- name: Add Hugging Face remote
|
| 23 |
+
run: |
|
| 24 |
+
git remote add hf https://${{ secrets.HF_USERNAME }}:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/${{ secrets.HF_USERNAME }}/${{ secrets.SPACE_NAME }}
|
| 25 |
|
| 26 |
+
- name: Commit changes if any
|
| 27 |
+
run: |
|
| 28 |
+
git add .
|
| 29 |
+
git diff --cached --quiet || git commit -m "Deploy to Hugging Face Spaces"
|
| 30 |
|
| 31 |
- name: Push to Hugging Face Spaces
|
|
|
|
|
|
|
| 32 |
run: |
|
| 33 |
+
git push hf main || echo "No changes to deploy."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dockerfile
CHANGED
|
@@ -34,8 +34,6 @@ RUN \
|
|
| 34 |
addgroup --system --gid 1001 nodejs; \
|
| 35 |
adduser --system --uid 1001 nextjs
|
| 36 |
|
| 37 |
-
COPY --from=builder /app/public ./public
|
| 38 |
-
|
| 39 |
# Automatically leverage output traces to reduce image size
|
| 40 |
COPY --from=builder --chown=1001:1001 /app/.next/standalone ./
|
| 41 |
COPY --from=builder --chown=1001:1001 /app/.next/static ./.next/static
|
|
|
|
| 34 |
addgroup --system --gid 1001 nodejs; \
|
| 35 |
adduser --system --uid 1001 nextjs
|
| 36 |
|
|
|
|
|
|
|
| 37 |
# Automatically leverage output traces to reduce image size
|
| 38 |
COPY --from=builder --chown=1001:1001 /app/.next/standalone ./
|
| 39 |
COPY --from=builder --chown=1001:1001 /app/.next/static ./.next/static
|
README.md
CHANGED
|
@@ -3,8 +3,9 @@ title: Transformers.js Playground
|
|
| 3 |
emoji: π
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
-
sdk:
|
| 7 |
-
pinned:
|
|
|
|
| 8 |
---
|
| 9 |
# Transformers.js Playground
|
| 10 |
|
|
|
|
| 3 |
emoji: π
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: true
|
| 8 |
+
app_port: 3000
|
| 9 |
---
|
| 10 |
# Transformers.js Playground
|
| 11 |
|
components/category/CategoryCard.tsx
CHANGED
|
@@ -40,7 +40,7 @@ const CategoryCard: React.FC<CategoryCardProps> = ({
|
|
| 40 |
);
|
| 41 |
|
| 42 |
return (
|
| 43 |
-
<div className={`rounded-xl p-6 text-white w-92 h-72 flex flex-col relative shadow-lg transition-transform duration-300 ease-in-out hover:scale-105 ${gradient}`}>
|
| 44 |
{isComingSoon ? (
|
| 45 |
<>
|
| 46 |
<CardContent />
|
|
|
|
| 40 |
);
|
| 41 |
|
| 42 |
return (
|
| 43 |
+
<div className={`rounded-xl max-w-sm mx-auto p-6 text-white w-92 h-72 flex flex-col relative shadow-lg transition-transform duration-300 ease-in-out hover:scale-105 ${gradient}`}>
|
| 44 |
{isComingSoon ? (
|
| 45 |
<>
|
| 46 |
<CardContent />
|