Website/.forgejo/workflows/push.yml
TudbuT a3e0f99a10
All checks were successful
/ Push website to server (push) Successful in 3s
some basic website stuff
2024-06-18 08:21:07 +02:00

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