File size: 813 Bytes
9e1ad69
 
 
 
 
 
97df6ca
 
 
 
 
 
9e1ad69
97df6ca
 
 
9e1ad69
 
 
97df6ca
 
 
 
 
 
 
750d6b0
97df6ca
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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