Spaces:
Runtime error
Runtime error
Commit ·
e7c8b02
1
Parent(s): e762600
Deploy files from GitHub repository
Browse files- Dockerfile +3 -3
- space/.github/workflows/main.yml +49 -0
- space/.gitignore +6 -0
Dockerfile
CHANGED
|
@@ -15,12 +15,12 @@ COPY . .
|
|
| 15 |
|
| 16 |
# Buat file .env dengan variabel environment yang dibutuhkan
|
| 17 |
RUN echo "DB_HOST=aws-0-ap-southeast-1.pooler.supabase.com" >> .env && \
|
| 18 |
-
echo "DB_USER=postgres.
|
| 19 |
-
echo "DB_PASSWORD=
|
| 20 |
echo "DB_PORT=5432" >> .env && \
|
| 21 |
echo "DB_NAME=postgres" >> .env && \
|
| 22 |
echo "HOST_ADDRESS = 0.0.0.0" >> .env && \
|
| 23 |
-
echo "HOST_PORT =
|
| 24 |
echo "EMAIL_VERIFICATION_DURATION = 2" >> .env
|
| 25 |
|
| 26 |
# Build aplikasi
|
|
|
|
| 15 |
|
| 16 |
# Buat file .env dengan variabel environment yang dibutuhkan
|
| 17 |
RUN echo "DB_HOST=aws-0-ap-southeast-1.pooler.supabase.com" >> .env && \
|
| 18 |
+
echo "DB_USER=postgres.yxwraotdmkseklnqrnlp" >> .env && \
|
| 19 |
+
echo "DB_PASSWORD=QUZUU2025" >> .env && \
|
| 20 |
echo "DB_PORT=5432" >> .env && \
|
| 21 |
echo "DB_NAME=postgres" >> .env && \
|
| 22 |
echo "HOST_ADDRESS = 0.0.0.0" >> .env && \
|
| 23 |
+
echo "HOST_PORT = 5432" >> .env && \
|
| 24 |
echo "EMAIL_VERIFICATION_DURATION = 2" >> .env
|
| 25 |
|
| 26 |
# Build aplikasi
|
space/.github/workflows/main.yml
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Deploy to Huggingface
|
| 2 |
+
on:
|
| 3 |
+
push:
|
| 4 |
+
branches:
|
| 5 |
+
- master
|
| 6 |
+
jobs:
|
| 7 |
+
deploy-to-huggingface:
|
| 8 |
+
runs-on: ubuntu-latest
|
| 9 |
+
steps:
|
| 10 |
+
# Checkout repository
|
| 11 |
+
- name: Checkout Repository
|
| 12 |
+
uses: actions/checkout@v3
|
| 13 |
+
# Setup Git
|
| 14 |
+
- name: Setup Git for Huggingface
|
| 15 |
+
run: |
|
| 16 |
+
git config --global user.email "abdan.hafidz@gmail.com"
|
| 17 |
+
git config --global user.name "abdanhafidz"
|
| 18 |
+
# Clone Huggingface Space Repository
|
| 19 |
+
- name: Clone Huggingface Space
|
| 20 |
+
env:
|
| 21 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 22 |
+
run: |
|
| 23 |
+
git clone https://huggingface.co/spaces/lifedebugger/quzuu-api-dev space
|
| 24 |
+
# Update Git Remote URL and Pull Latest Changes
|
| 25 |
+
- name: Update Remote and Pull Changes
|
| 26 |
+
env:
|
| 27 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 28 |
+
run: |
|
| 29 |
+
cd space
|
| 30 |
+
git remote set-url origin https://lifedebugger:$HF_TOKEN@huggingface.co/spaces/lifedebugger/quzuu-api-dev
|
| 31 |
+
git pull origin main || echo "No changes to pull"
|
| 32 |
+
# Clean Space Directory - Delete all files except .git
|
| 33 |
+
- name: Clean Space Directory
|
| 34 |
+
run: |
|
| 35 |
+
cd space
|
| 36 |
+
find . -mindepth 1 -not -path "./.git*" -delete
|
| 37 |
+
# Copy Files to Huggingface Space
|
| 38 |
+
- name: Copy Files to Space
|
| 39 |
+
run: |
|
| 40 |
+
rsync -av --exclude='.git' ./ space/
|
| 41 |
+
# Commit and Push to Huggingface Space
|
| 42 |
+
- name: Commit and Push to Huggingface
|
| 43 |
+
env:
|
| 44 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 45 |
+
run: |
|
| 46 |
+
cd space
|
| 47 |
+
git add .
|
| 48 |
+
git commit -m "Deploy files from GitHub repository" || echo "No changes to commit"
|
| 49 |
+
git push origin main || echo "No changes to push"
|
space/.gitignore
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.env
|
| 2 |
+
vendor/
|
| 3 |
+
quzuu-be.exe
|
| 4 |
+
README.md
|
| 5 |
+
.qodo
|
| 6 |
+
.idea/
|