Some checks failed
Deploy to web.hhivp.com / deploy (push) Failing after 3s
- Dockerfile multi-stage: node:22-alpine builds Astro → nginx:1.29-alpine отдаёт dist/. healthcheck wget --spider / - nginx.conf: gzip с подходящими типами (RSS/JSON/SVG/woff2), кэш /_astro/ immutable 1y, кэш css/js/img 30d, MIME application/rss+xml для feed, text/plain для robots/ai/llms/sitemap, кастомная 404 - docker-compose: контейнер anotherreflections-ru-v2 на 127.0.0.1:4084 (старый WP на :4080 остаётся для отката) - .gitea/workflows/deploy.yml: push в main → SSH-деплой на web, git fetch+reset → docker compose build → up -d → docker image prune (retention 7d по правилу проекта). Verify-шаг curl на :4084 - src/pages/404.astro — тематическая страница «не найдено» с навигацией
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: Deploy to web.hhivp.com
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up SSH key
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" | base64 -d > ~/.ssh/deploy_key
|
|
chmod 600 ~/.ssh/deploy_key
|
|
cat >> ~/.ssh/config <<EOF
|
|
Host web
|
|
HostName ${{ secrets.SSH_HOST }}
|
|
User ${{ secrets.SSH_USER }}
|
|
Port ${{ secrets.SSH_PORT }}
|
|
IdentityFile ~/.ssh/deploy_key
|
|
StrictHostKeyChecking accept-new
|
|
UserKnownHostsFile ~/.ssh/known_hosts
|
|
EOF
|
|
|
|
- name: Deploy
|
|
run: |
|
|
ssh web 'bash -s' <<'REMOTE'
|
|
set -euo pipefail
|
|
cd /opt/docker/sites/anotherreflections-ru-v2
|
|
git fetch --prune origin
|
|
git reset --hard origin/main
|
|
docker compose build --pull
|
|
docker compose up -d
|
|
# Чистка старых образов (CI/CD retention >7d по правилу проекта)
|
|
docker image prune -af --filter "until=168h" >/dev/null 2>&1 || true
|
|
REMOTE
|
|
|
|
- name: Verify
|
|
run: |
|
|
ssh web 'curl -sf -H "Host: anotherreflections.ru" http://127.0.0.1:4084/ -o /dev/null -w "HTTP %{http_code} | %{size_download} bytes\n"'
|