Spaces:
Paused
Paused
Add CD job for pushing changes to hugging face
Browse files- .github/workflows/cd.yml +0 -24
- .github/workflows/main.yml +41 -0
.github/workflows/cd.yml
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
name: Publish Python 🐍 distributions 📦 to PyPI
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
release:
|
| 5 |
-
types: [created]
|
| 6 |
-
|
| 7 |
-
jobs:
|
| 8 |
-
deploy:
|
| 9 |
-
runs-on: ubuntu-latest
|
| 10 |
-
|
| 11 |
-
steps:
|
| 12 |
-
- uses: actions/checkout@v4
|
| 13 |
-
- name: Set up Python
|
| 14 |
-
uses: actions/setup-python@v5
|
| 15 |
-
with:
|
| 16 |
-
python-version: '3.12'
|
| 17 |
-
- name: Install dependencies
|
| 18 |
-
run: |
|
| 19 |
-
pip install poetry
|
| 20 |
-
poetry build
|
| 21 |
-
- name: Build and publish
|
| 22 |
-
uses: pypa/gh-action-pypi-publish@release/v1
|
| 23 |
-
with:
|
| 24 |
-
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.github/workflows/main.yml
CHANGED
|
@@ -38,3 +38,44 @@ jobs:
|
|
| 38 |
|
| 39 |
- name: Image digest
|
| 40 |
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
- name: Image digest
|
| 40 |
run: echo ${{ steps.docker_build.outputs.digest }}
|
| 41 |
+
|
| 42 |
+
deploy:
|
| 43 |
+
runs-on: ubuntu-latest
|
| 44 |
+
|
| 45 |
+
steps:
|
| 46 |
+
- uses: actions/checkout@v4
|
| 47 |
+
- name: Set up Python
|
| 48 |
+
uses: actions/setup-python@v5
|
| 49 |
+
with:
|
| 50 |
+
python-version: '3.12'
|
| 51 |
+
- name: Install dependencies
|
| 52 |
+
run: |
|
| 53 |
+
pip install poetry
|
| 54 |
+
poetry build
|
| 55 |
+
- name: Build and publish
|
| 56 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
| 57 |
+
with:
|
| 58 |
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
| 59 |
+
|
| 60 |
+
push_to_huggingface:
|
| 61 |
+
runs-on: ubuntu-latest
|
| 62 |
+
|
| 63 |
+
steps:
|
| 64 |
+
- name: Checkout
|
| 65 |
+
uses: actions/checkout@v4
|
| 66 |
+
|
| 67 |
+
- name: Set up Python
|
| 68 |
+
uses: actions/setup-python@v5
|
| 69 |
+
with:
|
| 70 |
+
python-version: '3.12'
|
| 71 |
+
|
| 72 |
+
- name: Install dependencies
|
| 73 |
+
run: |
|
| 74 |
+
pip install huggingface_hub
|
| 75 |
+
|
| 76 |
+
- name: Push to Hugging Face
|
| 77 |
+
env:
|
| 78 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 79 |
+
run: |
|
| 80 |
+
huggingface-cli login --token $HF_TOKEN
|
| 81 |
+
git push https://huggingface.co/spaces/mhdzumair/mediaflow-proxy main
|