ci: added basic workflow of automated build and deploy

This commit is contained in:
2026-04-21 00:05:34 +03:30
parent 951d4d8301
commit 9b9413af6d

View File

@@ -0,0 +1,35 @@
name: Build and Deploy to CDN
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
run: |
git clone "$GITEA_REPO_URL" repo
cd repo
git checkout $GITEA_COMMIT_SHA
env:
GITEA_REPO_URL: ${{ gitea.repository.url }}
GITEA_COMMIT_SHA: ${{ gitea.sha }}
- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
- name: Verify Node and npm
run: node --version && npm --version
- name: Install dependencies and build
run: |
cd repo
npm ci
npm run build
npm test
- name: Deploy via rsync
run: rsync -avz --delete repo/dist ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/