Spaces:
Sleeping
Sleeping
gary-boon
Claude
commited on
Commit
Β·
07be0bf
1
Parent(s):
8b77dd5
Consolidate HuggingFace deployment into security workflow
Browse files- Update security-check.yml to deploy to both CPU and GPU spaces
- Remove duplicate deploy-to-huggingface.yml workflow
- Now single workflow handles security checks and dual deployment
- CPU Space: visualisable-ai/api
- GPU Space: visualisable-ai/api-gpu
π€ Generated with Claude Code (https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
.github/workflows/deploy-to-huggingface.yml
DELETED
|
@@ -1,80 +0,0 @@
|
|
| 1 |
-
name: Deploy to HuggingFace Spaces
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
push:
|
| 5 |
-
branches: [ main ]
|
| 6 |
-
workflow_dispatch:
|
| 7 |
-
|
| 8 |
-
jobs:
|
| 9 |
-
deploy-to-cpu-space:
|
| 10 |
-
runs-on: ubuntu-latest
|
| 11 |
-
steps:
|
| 12 |
-
- uses: actions/checkout@v3
|
| 13 |
-
with:
|
| 14 |
-
fetch-depth: 0
|
| 15 |
-
lfs: true
|
| 16 |
-
|
| 17 |
-
- name: Push to CPU HuggingFace Space
|
| 18 |
-
env:
|
| 19 |
-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 20 |
-
run: |
|
| 21 |
-
# Add HuggingFace CPU Space as remote (visualisable-ai/api)
|
| 22 |
-
git remote add hf-cpu https://huggingface.co/spaces/visualisable-ai/api
|
| 23 |
-
|
| 24 |
-
# Configure git with HF token
|
| 25 |
-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
| 26 |
-
git config --global user.name "github-actions[bot]"
|
| 27 |
-
|
| 28 |
-
# Push to CPU Space
|
| 29 |
-
git push https://visualisable-ai:$HF_TOKEN@huggingface.co/spaces/visualisable-ai/api main --force
|
| 30 |
-
|
| 31 |
-
echo "β
Deployed to CPU HuggingFace Space (visualisable-ai/api)"
|
| 32 |
-
|
| 33 |
-
deploy-to-gpu-space:
|
| 34 |
-
runs-on: ubuntu-latest
|
| 35 |
-
steps:
|
| 36 |
-
- uses: actions/checkout@v3
|
| 37 |
-
with:
|
| 38 |
-
fetch-depth: 0
|
| 39 |
-
lfs: true
|
| 40 |
-
|
| 41 |
-
- name: Push to GPU HuggingFace Space
|
| 42 |
-
env:
|
| 43 |
-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 44 |
-
run: |
|
| 45 |
-
# Add HuggingFace GPU Space as remote (visualisable-ai/api-gpu)
|
| 46 |
-
git remote add hf-gpu https://huggingface.co/spaces/visualisable-ai/api-gpu
|
| 47 |
-
|
| 48 |
-
# Configure git with HF token
|
| 49 |
-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
| 50 |
-
git config --global user.name "github-actions[bot]"
|
| 51 |
-
|
| 52 |
-
# Push to GPU Space
|
| 53 |
-
git push https://visualisable-ai:$HF_TOKEN@huggingface.co/spaces/visualisable-ai/api-gpu main --force
|
| 54 |
-
|
| 55 |
-
echo "β
Deployed to GPU HuggingFace Space (visualisable-ai/api-gpu)"
|
| 56 |
-
|
| 57 |
-
notify:
|
| 58 |
-
needs: [deploy-to-cpu-space, deploy-to-gpu-space]
|
| 59 |
-
runs-on: ubuntu-latest
|
| 60 |
-
if: always()
|
| 61 |
-
steps:
|
| 62 |
-
- name: Deployment Summary
|
| 63 |
-
run: |
|
| 64 |
-
echo "## HuggingFace Deployment Summary" >> $GITHUB_STEP_SUMMARY
|
| 65 |
-
echo "" >> $GITHUB_STEP_SUMMARY
|
| 66 |
-
echo "- CPU Space: ${{ needs.deploy-to-cpu-space.result }}" >> $GITHUB_STEP_SUMMARY
|
| 67 |
-
echo "- GPU Space: ${{ needs.deploy-to-gpu-space.result }}" >> $GITHUB_STEP_SUMMARY
|
| 68 |
-
echo "" >> $GITHUB_STEP_SUMMARY
|
| 69 |
-
|
| 70 |
-
if [ "${{ needs.deploy-to-cpu-space.result }}" = "success" ]; then
|
| 71 |
-
echo "β
CPU Space deployed successfully" >> $GITHUB_STEP_SUMMARY
|
| 72 |
-
else
|
| 73 |
-
echo "β CPU Space deployment failed" >> $GITHUB_STEP_SUMMARY
|
| 74 |
-
fi
|
| 75 |
-
|
| 76 |
-
if [ "${{ needs.deploy-to-gpu-space.result }}" = "success" ]; then
|
| 77 |
-
echo "β
GPU Space deployed successfully" >> $GITHUB_STEP_SUMMARY
|
| 78 |
-
else
|
| 79 |
-
echo "β GPU Space deployment failed" >> $GITHUB_STEP_SUMMARY
|
| 80 |
-
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.github/workflows/security-check.yml
CHANGED
|
@@ -111,7 +111,7 @@ jobs:
|
|
| 111 |
fetch-depth: 0
|
| 112 |
lfs: true
|
| 113 |
|
| 114 |
-
- name: Push to HuggingFace Space
|
| 115 |
env:
|
| 116 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 117 |
run: |
|
|
@@ -119,12 +119,26 @@ jobs:
|
|
| 119 |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
| 120 |
git config --global user.name "github-actions[bot]"
|
| 121 |
|
| 122 |
-
# Add HuggingFace remote with authentication
|
| 123 |
-
git remote add
|
| 124 |
|
| 125 |
-
# Push to
|
| 126 |
-
echo "Deploying to HuggingFace
|
| 127 |
-
git push
|
| 128 |
|
| 129 |
-
echo "β
Deployed to HuggingFace
|
| 130 |
-
echo "π
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
fetch-depth: 0
|
| 112 |
lfs: true
|
| 113 |
|
| 114 |
+
- name: Push to CPU HuggingFace Space
|
| 115 |
env:
|
| 116 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 117 |
run: |
|
|
|
|
| 119 |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
| 120 |
git config --global user.name "github-actions[bot]"
|
| 121 |
|
| 122 |
+
# Add CPU HuggingFace Space remote with authentication
|
| 123 |
+
git remote add hf-cpu https://visualisable-ai:$HF_TOKEN@huggingface.co/spaces/visualisable-ai/api
|
| 124 |
|
| 125 |
+
# Push to CPU Space
|
| 126 |
+
echo "Deploying to CPU HuggingFace Space..."
|
| 127 |
+
git push hf-cpu main:main --force
|
| 128 |
|
| 129 |
+
echo "β
Deployed to CPU HuggingFace Space successfully!" >> $GITHUB_STEP_SUMMARY
|
| 130 |
+
echo "π CPU Space: https://huggingface.co/spaces/visualisable-ai/api" >> $GITHUB_STEP_SUMMARY
|
| 131 |
+
|
| 132 |
+
- name: Push to GPU HuggingFace Space
|
| 133 |
+
env:
|
| 134 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 135 |
+
run: |
|
| 136 |
+
# Add GPU HuggingFace Space remote with authentication
|
| 137 |
+
git remote add hf-gpu https://visualisable-ai:$HF_TOKEN@huggingface.co/spaces/visualisable-ai/api-gpu
|
| 138 |
+
|
| 139 |
+
# Push to GPU Space
|
| 140 |
+
echo "Deploying to GPU HuggingFace Space..."
|
| 141 |
+
git push hf-gpu main:main --force
|
| 142 |
+
|
| 143 |
+
echo "β
Deployed to GPU HuggingFace Space successfully!" >> $GITHUB_STEP_SUMMARY
|
| 144 |
+
echo "π GPU Space: https://huggingface.co/spaces/visualisable-ai/api-gpu" >> $GITHUB_STEP_SUMMARY
|