File tree 1 file changed +18
-9
lines changed
1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -28,16 +28,25 @@ jobs:
28
28
# - name: Run Tests
29
29
# run: |
30
30
# python manage.py test
31
- - name : Deploy to Server
32
- env :
33
- SSH_PRIVATE_KEY : ${{ secrets.SSH_KEY }}
34
- SSH_HOST : ${{ secrets.SSH_HOST }}
35
- SSH_USERNAME : ${{ secrets.SSH_USER }}
31
+ - name : Configure SSH
32
+ run : |
33
+ mkdir -p ~/.ssh/
34
+ echo "$SSH_KEY" > ~/.ssh/production.key
35
+ chmod 600 ~/.ssh/production.key
36
+ cat >>~/.ssh/config <<END
37
+ Host production
38
+ HostName $SSH_HOST
39
+ User $SSH_USER
40
+ IdentityFile ~/.ssh/production.key
41
+ StrictHostKeyChecking no
42
+ END
43
+ env :
44
+ SSH_USER : ${{ secrets.STAGING_SSH_USER }}
45
+ SSH_KEY : ${{ secrets.STAGING_SSH_KEY }}
46
+ SSH_HOST : ${{ secrets.STAGING_SSH_HOST }}
47
+ - name : Deploy to Server
36
48
run : |
37
- eval `ssh-agent -s`
38
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
39
- ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
40
- ssh $SSH_USERNAME@$SSH_HOST '
49
+ ssh production '
41
50
cd /home/django/bakeup/ &&
42
51
git pull origin main &&
43
52
source /home/django/djangoenv/bin/activate &&
You can’t perform that action at this time.
0 commit comments