File size: 1,986 Bytes
a4df109
 
 
d98fad8
 
 
 
 
a4df109
 
 
 
c9c2e0b
1bb9e65
c9c2e0b
a4df109
dcca006
a4df109
 
 
dcca006
 
 
 
a4df109
dcca006
 
 
 
 
 
afcba5a
dcca006
 
 
 
 
5c86508
 
dcca006
 
6f017c1
 
 
dcca006
3beffac
 
 
dcca006
 
 
694c2b9
3beffac
dcca006
 
694c2b9
dcca006
 
 
7477bfe
dcca006
4752737
 
 
dcca006
aefc56f
 
 
a4df109
 
 
 
aefc56f
a4df109
 
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Sync to Hugging Face hub
on:
  push:
    branches:
    - main
  pull_request:
    branches:
      - main

  # to run this workflow manually from the Actions tab
  workflow_dispatch:

env:
  api_secret: ${{ secrets.HF }}

jobs:
  Build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      # Set up Python 3.11 environment
      - name: Set up Python 3.11
        uses: actions/setup-python@v4
        with:
          python-version: "3.11"

      # Install dependencies
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt

      - name: Model Testing
        run: |
          python3 inference.py
  
  DeployDev:
    name: Deploy to Development
    needs: [Build]
    runs-on: ubuntu-latest
    environment:
      name: Staging
      url: 'https://huggingface.co/spaces/cccmatthew/gp30-dev'
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Add remote 
        env:
          HF: ${{ secrets.HF }}
        run: git remote add space https://cccmatthew:$HF@huggingface.co/spaces/cccmatthew/gp30-dev
      - name: Push to hub
        env:
          HF: ${{ secrets.HF }}
        run: git push --force https://cccmatthew:$HF@huggingface.co/spaces/cccmatthew/gp30-dev main

  DeployProd:
    name: Deploy to Production 
    needs: [DeployDev]
    runs-on: ubuntu-latest
    environment:
      name: Production
      url: 'https://huggingface.co/spaces/cccmatthew/gp30-deployment'
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Add remote 
        env:
          HF: ${{ secrets.HF }}
        run: git remote add space https://cccmatthew:$HF@huggingface.co/spaces/cccmatthew/gp30-deployment
      - name: Push to hub
        env:
          HF: ${{ secrets.HF }}
        run: git push --force https://cccmatthew:$HF@huggingface.co/spaces/cccmatthew/gp30-deployment main