-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 1002 Bytes
/
hostinger.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
name: Deploy to Hostinger
on:
push:
branches: [ "master" ]
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Copy file via SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
source: "."
target: "/home/micho/cine"
rm: true
overwrite: true
- name: Set up SSH key
run: echo "${{ secrets.SSH_PRIVATE_KEY }}" > ./ssh_key && chmod 600 ./ssh_key
- name: Run build script on VM
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
run: |
ssh -i ./ssh_key -p $SSH_PORT -o StrictHostKeyChecking=no $SSH_USERNAME@$SSH_HOST 'cd /home/micho/cine/ && bash build.sh'