This takes part of the work being done in #96 that was reverted but still useful. Note Tailwind and Fresh weren't upgraded because there's no security vulnerability in either, and I have found the new versions to be worse in performance. Thos will likely stay at those fixed versions going forward.
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Configure SSH
|
|
run: |
|
|
mkdir -p ~/.ssh/
|
|
echo "$SSH_KEY" | tr -d '\r' > ~/.ssh/server.key
|
|
chmod 600 ~/.ssh/server.key
|
|
cat >>~/.ssh/config <<END
|
|
Host server
|
|
HostName $SSH_HOST
|
|
User $SSH_USER
|
|
IdentityFile ~/.ssh/server.key
|
|
StrictHostKeyChecking no
|
|
END
|
|
cat ~/.ssh/config
|
|
env:
|
|
SSH_HOST: ${{ secrets.SSH_HOST }}
|
|
SSH_USER: ${{ secrets.SSH_USER }}
|
|
SSH_KEY: ${{ secrets.SSH_KEY }}
|
|
|
|
- name: Deploy via SSH
|
|
run: ssh server 'cd apps/bewcloud && git add . && git stash && git pull origin main && git stash clear && git remote prune origin && cp ../../scripts/config/bewcloud/.env . && cp ../../scripts/config/bewcloud/bewcloud.config.ts . && cp ../../scripts/config/bewcloud/docker-compose.yml . && docker system prune -f && docker compose up -d --build && docker compose ps && docker compose logs'
|