-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (42 loc) · 1.72 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Jobs to deploy my changes directly to aws server
name: Deploy to Lightsail
# For both dev pushes and MRs to main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
# SSHing into AWS ec2 instance and pulling repo into /var/www
jobs:
# Ubuntu image for runner
ssh-connect:
runs-on: ubuntu-latest
steps:
- name: ssh-autodeployment-pipeline
# # Using pipeline image configured for using ssh
# uses: easingthemes/ssh-deploy@v2.1.4
# env:
# SSH_PRIVATE_KEY: ${{ secrets.AWS_SSH_KEY }}
# REMOTE_HOST: 13.127.86.120
# REMOTE_USER: ubuntu
# REMOTE_PORT: 22
# SOURCE: "."
# TARGET: /home/bits_vaccination_portal/new-repo/
uses: cross-the-world/ssh-pipeline@v1.2.0
# Login details
with:
# ssh remote host (AWS server)
host: 13.127.86.120
# ssh remote port (firewall opened on 22, 80, 443)
port: 22
# ssh remote user (not giving root perms currently)
user: bits_vaccination_portal
# Using github secret for ssh key
key: ${{ secrets.AWS_SSH_KEY }}
# ssh remote password
pass: # dont have one :p
# connection timeout to remote host
connect_timeout: 60s
# execute commands on to pull changes
script: cd /home/bits_vaccination_portal/BITS_Vaccination_Portal && git status && git config --global --add safe.directory /home/bits_vaccination_portal/BITS_Vaccination_Portal && echo ${{ secrets.AWS_SUDO_PASS }} | sudo -S git pull https://mohitdmak:${{ secrets.REP_ACCESS_TOKEN_AWS }}@github.com/mohitdmak/BITS_Vaccination_Portal main -s recursive -X theirs