hetvaghasia39 commited on
Commit
d365c26
1 Parent(s): eafd360

Update main.yaml

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yaml +13 -27
.github/workflows/main.yaml CHANGED
@@ -1,34 +1,20 @@
1
- name: Deploy to EC2
2
-
3
  on:
4
  push:
5
- branches:
6
- - main
 
 
7
 
8
  jobs:
9
- deploy:
10
  runs-on: ubuntu-latest
11
-
12
  steps:
13
- - name: Checkout code
14
- uses: actions/checkout@v2
15
-
16
- - name: Install SSH Client
17
- run: sudo apt-get install -y openssh-client
18
-
19
- - name: Set up SSH
20
- uses: webfactory/ssh-agent@v0.5.3
21
  with:
22
- ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
23
-
24
- - name: SSH Command
25
- run: |
26
- ssh -o StrictHostKeyChecking=no -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'cd infinity_talks/ && git pull https://het-vaghasia:${{ secrets.GIT_TOKEN }}@github.com/hetvaghasia39/infinity_talks.git'
27
- ssh -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'sudo systemctl stop daphne gunicorn; cd infinity_talks/; source .venv/bin/activate; pip install -r requirements.txt; ./manage.py migrate;'
28
- ssh -o StrictHostKeyChecking=no -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'sudo systemctl restart gunicorn'
29
- ssh -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'sudo systemctl daemon-reload'
30
- ssh -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'sudo systemctl restart gunicorn.socket gunicorn.service'
31
- ssh -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'sudo systemctl restart daphne'
32
- ssh -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'sudo nginx -t && sudo systemctl restart nginx'
33
- ssh -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'sudo systemctl status gunicorn'
34
- ssh -i /tmp/deploy-key.pem ubuntu@3.6.59.40 'sudo systemctl status daphne'
 
1
+ name: Sync to Hugging Face hub
 
2
  on:
3
  push:
4
+ branches: [main]
5
+
6
+ # to run this workflow manually from the Actions tab
7
+ workflow_dispatch:
8
 
9
  jobs:
10
+ sync-to-hub:
11
  runs-on: ubuntu-latest
 
12
  steps:
13
+ - uses: actions/checkout@v3
 
 
 
 
 
 
 
14
  with:
15
+ fetch-depth: 0
16
+ lfs: true
17
+ - name: Push to hub
18
+ env:
19
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
20
+ run: git push --force https://hetvaghasia39:$HF_TOKEN@huggingface.co/spaces/hetvaghasia39/PragetX-RAG-Chatbot main