-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (28 loc) · 863 Bytes
/
main.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
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: master
- name: Set up Docker
uses: docker/setup-buildx-action@v1
- name: Set up SSH
run: |
sudo apt-get update
sudo apt-get install -y openssh-client
mkdir -p ~/.ssh/
echo "${{ secrets.SSH_ONOH }}" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
- name: Deploy to server
run: |
ssh -o StrictHostKeyChecking=no [email protected] -p1805 "\
echo '${{ secrets.SUDO_PASSWORD }}' | sudo -S bash -c 'cd /var/www/onenation_oneheart && git checkout master && git pull origin master && php artisan migrate && exit'"