@@ -22,31 +22,13 @@ jobs:
2222 key: ${{ secrets.SSH_PRIVATE_KEY }}
2323 args: "-tt"
2424
25- install-dependencies:
26- needs: [deploy-via-sftp]
27- runs-on: ubuntu-latest
28- steps:
29- - name: Installing requirements for ${{ env.REPO_NAME }}
30- uses: fifsky/ssh-action@master
31- with:
32- # install the libraries required for your bot
33- # setup venv and then install the requirements
34- command: |
35- source venv/bin/activate
36- pip install --upgrade pip
37- pip install -U -r ./venv/${{ env.REPO_NAME }}/requirements.txt
38- host: ${{ env.VPS_IP }}
39- user: ${{ env.VPS_USER }}
40- key: ${{ secrets.SSH_PRIVATE_KEY }}
41- args: "-tt"
42-
4325 deploy-via-sftp:
4426 needs: [setup-venv]
4527 runs-on: ubuntu-latest
4628 steps:
4729 - name: Checkout
4830 uses: actions/checkout@v2
49-
31+
5032 - name: Deploy to Server
5133 uses: wlixcc/SFTP-Deploy-Action@v1.2.5
5234 with:
5941 # destination of the code on the server
6042 remote_path: ./venv/${{ env.REPO_NAME }}/
6143 sftpargs: '-o ConnectTimeout=5'
62-
44+
45+ install-dependencies:
46+ needs: [deploy-via-sftp]
47+ runs-on: ubuntu-latest
48+ steps:
49+ - name: Installing requirements for ${{ env.REPO_NAME }}
50+ uses: fifsky/ssh-action@master
51+ with:
52+ # install the libraries required for your bot
53+ # setup venv and then install the requirements
54+ command: |
55+ source venv/bin/activate
56+ pip install --upgrade pip
57+ pip install -U -r ./venv/${{ env.REPO_NAME }}/requirements.txt
58+ host: ${{ env.VPS_IP }}
59+ user: ${{ env.VPS_USER }}
60+ key: ${{ secrets.SSH_PRIVATE_KEY }}
61+ args: "-tt"
62+
6363 add-secret-variables:
64- needs: [ deploy-via-sftp, install-dependencies ]
64+ needs: [deploy-via-sftp]
6565 runs-on: ubuntu-latest
6666 timeout-minutes: 2
6767 steps:
8989 key: ${{ secrets.SSH_PRIVATE_KEY }}
9090
9191 create-systemctl-service:
92- needs: [add-secret-variables, deploy-via-sftp ]
92+ needs: [add-secret-variables, install-dependencies ]
9393 runs-on: ubuntu-latest
9494 steps:
9595 - id: creating-systemctl-service
@@ -118,7 +118,7 @@ jobs:
118118 key: ${{ secrets.SSH_PRIVATE_KEY }}
119119
120120 create-systemctl-restart:
121- needs: [create-systemctl-service, add-secret-variables, deploy-via-sftp ]
121+ needs: [create-systemctl-service]
122122 runs-on: ubuntu-latest
123123 steps:
124124 - id: create-systemctl-restart-service
0 commit comments