| 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 | |