40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
name: Deploy Iddaai Frontend
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install sshpass
|
|
run: sudo apt-get update && sudo apt-get install -y sshpass
|
|
|
|
- name: Deploy to Raspberry Pi via rsync
|
|
env:
|
|
SERVER_PASSWORD: ${{ secrets.SERVER_PASSWORD }}
|
|
SERVER_IP: "95.70.252.214"
|
|
SERVER_PORT: "2222"
|
|
SERVER_USER: "haruncan"
|
|
run: |
|
|
export SSHPASS=$SERVER_PASSWORD
|
|
sshpass -e rsync -avz --exclude node_modules --exclude .git --exclude dist --exclude .next --exclude .DS_Store -e "ssh -o StrictHostKeyChecking=no -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_IP:~/apps/iddaai/fe/
|
|
|
|
- name: Restart Frontend Docker Service
|
|
uses: appleboy/ssh-action@v1.0.3
|
|
with:
|
|
host: "95.70.252.214"
|
|
port: "2222"
|
|
username: "haruncan"
|
|
password: ${{ secrets.SERVER_PASSWORD }}
|
|
script: |
|
|
cd ~/apps/iddaai
|
|
docker compose build frontend
|
|
docker compose up -d frontend
|