35 lines
720 B
YAML
35 lines
720 B
YAML
name: Deploy Pages
|
||
|
||
on:
|
||
push:
|
||
branches: [main]
|
||
|
||
jobs:
|
||
deploy:
|
||
runs-on: ubuntu-latest # метка твоего runner'а
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@v4
|
||
|
||
- name: Setup Node
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: 22
|
||
cache: npm
|
||
|
||
- name: Build
|
||
run: |
|
||
npm ci
|
||
npm run build
|
||
|
||
- name: Deploy to /var/www/pages
|
||
run: |
|
||
if ! command -v rsync &> /dev/null; then
|
||
sudo apt-get update && sudo apt-get install -y rsync
|
||
fi
|
||
|
||
TARGET="/var/www/pages/${{ gitea.repository }}"
|
||
mkdir -p "$TARGET"
|
||
|
||
rsync -a --delete dist/ "$TARGET/"
|