25 lines
727 B
YAML
25 lines
727 B
YAML
on: push
|
|
|
|
|
|
jobs:
|
|
push:
|
|
name: Push website to server
|
|
|
|
runs-on: 'docker'
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Push to server
|
|
env:
|
|
SSH_PRIVATEKEY: ${{ secrets.SSH_PRIVATEKEY }}
|
|
BB_HOST: ${{ vars.BB_HOST }}
|
|
BB_PORT: ${{ vars.BB_PORT }}
|
|
BB_PATH: ${{ vars.BB_PATH }}
|
|
run: |
|
|
tar -cvzf website.tar.gz . || true
|
|
echo "$SSH_PRIVATEKEY" > ssh_key
|
|
chmod 700 ssh_key
|
|
scp -o StrictHostKeyChecking=no -i ssh_key -P "$BB_PORT" "website.tar.gz" "root@$BB_HOST:$BB_PATH" &&
|
|
(ssh -o StrictHostKeyChecking=no -i ssh_key -p "$BB_PORT" "root@$BB_HOST" "cd '$BB_PATH' && bash restart.sh" || true)
|
|
rm ssh_key
|