Files
originsdigital/.gitea/workflows/deploy.yml
Tetardtek 4a3be2a323
Some checks failed
CI/CD — Build & Deploy / Build (push) Failing after 1m47s
CI/CD — Build & Deploy / Deploy to VPS (push) Has been skipped
feat: initial project structure — Express/TS/TypeORM + React/TS + Docker + Gitea CI
2026-03-14 04:13:58 +01:00

52 lines
1.2 KiB
YAML

name: CI/CD — Build & Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: |
backend/package-lock.json
frontend/package-lock.json
- name: Install & build backend
working-directory: backend
run: |
npm ci
npm run build
- name: Install & build frontend
working-directory: frontend
run: |
npm ci
npm run build
deploy:
name: Deploy to VPS
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/tetardtek/github/originsdigital
git pull origin main
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build