feat: add gitea actions ci/cd pipeline for automatic deployment
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
name: Deploy Iddaai Frontend
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Deploy to Raspberry Pi via rsync
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
|
||||||
|
SERVER_IP: "95.70.252.214"
|
||||||
|
SERVER_PORT: "2222"
|
||||||
|
SERVER_USER: "haruncan"
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
ssh-keyscan -p $SERVER_PORT $SERVER_IP >> ~/.ssh/known_hosts
|
||||||
|
rsync -avz --exclude node_modules --exclude .git --exclude dist --exclude .next --exclude .DS_Store -e "ssh -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"
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
cd ~/apps/iddaai
|
||||||
|
docker compose build frontend
|
||||||
|
docker compose up -d frontend
|
||||||
Reference in New Issue
Block a user