VashTheStampede123 commited on
Commit
0ef8334
·
1 Parent(s): 5127e92

github action force commit

Browse files
.github/workflows/sync-to-space.yaml CHANGED
@@ -1,19 +1,59 @@
1
- name: Sync to Hugging Face Space
 
2
  on:
3
  push:
4
  branches: [ master ]
 
 
5
  workflow_dispatch:
6
 
7
  jobs:
8
- sync-to-hub:
9
  runs-on: ubuntu-latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  steps:
11
  - uses: actions/checkout@v3
12
  with:
13
  fetch-depth: 0
14
  lfs: true
15
- - name: Push to Space
16
  env:
17
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
18
  run: |
19
- git push -f https://VashTheStampede123:${HF_TOKEN}@huggingface.co/spaces/VashTheStampede123/test master:main
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: CI/CD to Hugging Face Space
2
+
3
  on:
4
  push:
5
  branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
  workflow_dispatch:
9
 
10
  jobs:
11
+ test:
12
  runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ with:
16
+ lfs: true
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v4
19
+ with:
20
+ python-version: "3.10"
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install -r requirements.txt
25
+ - name: Run tests
26
+ run: pytest
27
+
28
+ deploy:
29
+ needs: test
30
+ runs-on: ubuntu-latest
31
+ if: success()
32
  steps:
33
  - uses: actions/checkout@v3
34
  with:
35
  fetch-depth: 0
36
  lfs: true
37
+ - name: Push to Hugging Face Space
38
  env:
39
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
40
  run: |
41
+ git push https://VashTheStampede123:${HF_TOKEN}@huggingface.co/spaces/VashTheStampede123/Dark_Fantasy_Image_Generator master:main
42
+ - name: Notify Discord
43
+ if: always()
44
+ uses: Ilshidur/action-discord@master
45
+ with:
46
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
47
+ args: |
48
+ Hugging Face Space *Dark_Fantasy_Image_Generator* synced with latest GitHub code!
49
+ notify-failure:
50
+ needs: test
51
+ runs-on: ubuntu-latest
52
+ if: failure()
53
+ steps:
54
+ - name: Notify Discord of failure
55
+ uses: Ilshidur/action-discord@master
56
+ with:
57
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
58
+ args: |
59
+ Tests failed! Deployment to Hugging Face Space skipped.
requirements.txt CHANGED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ streamlit
2
+ pytest
3
+ huggingface_hub