LazyHuman10 commited on
Commit
9e39bcc
·
1 Parent(s): 2c111dc

Replace Azure workflow with Hugging Face keep-alive

Browse files
.github/workflows/keep-hf-space-awake.yml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Keep Hugging Face Space Awake
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 */12 * * *"
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ ping-space:
10
+ runs-on: ubuntu-latest
11
+ timeout-minutes: 5
12
+
13
+ steps:
14
+ - name: Ping Plexi Space health endpoint
15
+ env:
16
+ SPACE_HEALTH_URL: https://lazyhuman-plexi.hf.space/_stcore/health
17
+ run: |
18
+ curl -fsS --retry 3 --retry-all-errors --max-time 30 "$SPACE_HEALTH_URL"
.github/workflows/main_plexi.yml DELETED
@@ -1,76 +0,0 @@
1
- # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2
- # More GitHub Actions for Azure: https://github.com/Azure/actions
3
- # More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions
4
-
5
- name: Build and deploy Python app to Azure Web App - plexi
6
-
7
- on:
8
- push:
9
- branches:
10
- - main
11
- workflow_dispatch:
12
-
13
- jobs:
14
- build:
15
- runs-on: ubuntu-latest
16
- permissions:
17
- contents: read #This is required for actions/checkout
18
-
19
- steps:
20
- - uses: actions/checkout@v4
21
-
22
- - name: Set up Python version
23
- uses: actions/setup-python@v5
24
- with:
25
- python-version: '3.11'
26
-
27
- # 🛠️ Local Build Section (Optional)
28
- # The following section in your workflow is designed to catch build issues early on the client side, before deployment. This can be helpful for debugging and validation. However, if this step significantly increases deployment time and early detection is not critical for your workflow, you may remove this section to streamline the deployment process.
29
- - name: Create and Start virtual environment and Install dependencies
30
- run: |
31
- python -m venv antenv
32
- source antenv/bin/activate
33
- pip install -r requirements.txt
34
-
35
- # By default, when you enable GitHub CI/CD integration through the Azure portal, the platform automatically sets the SCM_DO_BUILD_DURING_DEPLOYMENT application setting to true. This triggers the use of Oryx, a build engine that handles application compilation and dependency installation (e.g., pip install) directly on the platform during deployment. Hence, we exclude the antenv virtual environment directory from the deployment artifact to reduce the payload size.
36
- - name: Upload artifact for deployment jobs
37
- uses: actions/upload-artifact@v4
38
- with:
39
- name: python-app
40
- path: |
41
- .
42
- !antenv/
43
-
44
- # 🚫 Opting Out of Oryx Build
45
- # If you prefer to disable the Oryx build process during deployment, follow these steps:
46
- # 1. Remove the SCM_DO_BUILD_DURING_DEPLOYMENT app setting from your Azure App Service Environment variables.
47
- # 2. Refer to sample workflows for alternative deployment strategies: https://github.com/Azure/actions-workflow-samples/tree/master/AppService
48
-
49
-
50
- deploy:
51
- runs-on: ubuntu-latest
52
- needs: build
53
- permissions:
54
- id-token: write #This is required for requesting the JWT
55
- contents: read #This is required for actions/checkout
56
-
57
- steps:
58
- - name: Download artifact from build job
59
- uses: actions/download-artifact@v4
60
- with:
61
- name: python-app
62
-
63
- - name: Login to Azure
64
- uses: azure/login@v2
65
- with:
66
- client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_57930D6EA9E0445795ADC1381E0BF637 }}
67
- tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_4402E3B59B64422D9FCB755F7BE45091 }}
68
- subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_407A4A4497714262919D51936A8FEC81 }}
69
-
70
- - name: 'Deploy to Azure Web App'
71
- uses: azure/webapps-deploy@v3
72
- id: deploy-to-webapp
73
- with:
74
- app-name: 'plexi'
75
- slot-name: 'Production'
76
-