Files
kadev-landing/.gitea/workflows/deploy.yml
T
kaurcev f2945b9b64
Build and Deploy / build-and-deploy (push) Canceled after 2m13s
fix workflow branch and docker configs
2026-10-11 17:10:29 +06:00

48 lines
1.2 KiB
YAML

name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build React app
run: npm run build
- name: Deploy files to Remote Server via rsync
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
REMOTE_HOST: ${{ secrets.SERVER_HOST }}
REMOTE_USER: ${{ secrets.SERVER_USER }}
TARGET: ${{ secrets.SERVER_TARGET_PATH }}
SOURCE: "dist/ Dockerfile docker-compose.yml"
ARGS: "-avz --delete"
- name: Run Docker container on Remote Server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd ${{ secrets.SERVER_TARGET_PATH }}
docker compose down || true
docker compose up -d --build