Files
sgeUpdated/.gitea/workflows/deploy.yml
Abdulbari e695d06f5b
Some checks failed
CI/CD Pipeline / deploy_testing (push) Has been skipped
CI/CD Pipeline / deploy_production (push) Failing after 56s
Add CI/CD deploy workflows
2025-08-27 03:04:15 +03:00

50 lines
1.5 KiB
YAML

name: CI/CD Pipeline
on:
push:
branches:
- main
- develop
jobs:
deploy_testing:
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Deploy to Testing Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
echo "✅ Connected to Testing Server"
cd /home/${{ secrets.SERVER_USER }}/app
docker stop myapp || true
docker rm myapp || true
docker build -t myapp:latest .
docker run -d --name myapp -p 3000:3000 myapp:latest
deploy_production:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Deploy to Production Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PROD_SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
echo "✅ Connected to Production Server"
cd /home/${{ secrets.SERVER_USER }}/app
docker stop myapp || true
docker rm myapp || true
docker build -t myapp:latest .
docker run -d --name myapp -p 3000:3000 myapp:latest