name: CI/CD env: HF_TOKEN: ${{secrets.HUGGINGFACE_ACCESS_TOKEN}} HF_USERNAME: stestoni91 HF_SPACE: text-summary-app on: push: branches: [main] jobs: ci-cd: runs-on: ubuntu-latest steps: - name: Clone repo uses: actions/checkout@v2 with: fetch-depth: 0 - name: Install python uses: actions/setup-python@v1 with: python-version: 3.10.14 - name: Install dependencies run: pip install -r requirements.txt - name: Run tests run: python -m pytest test_app.py - name: Synch GitHub and HF run: git remote add space https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$HF_SPACE - name: Deploy app run: git push --force https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$HF_SPACE