demo / .github /workflows /main.yml
Chaker Saidi
Modify CI to CI/CD and add deployment step
865462a unverified
Raw
History Blame Contribute Delete
723 Bytes
name: CI/CD
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Test import
run: python -c "from transformers import pipeline; print('OK')"
- name: Push to Hugging Face Spaces
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git remote add space https://huggingface.co/spaces/chaker88/demo || true
git push https://chaker88:$HF_TOKEN@huggingface.co/spaces/chaker88/demo main --force