Some checks failed
deploy / deploy (push) Failing after 12s
- Бэкап старой версии на ветке vite-react-backup - Stack: Astro 5 + nginx:alpine runtime, образ ~50 МБ (был ~600 МБ) - @astrojs/rss заменён ручным buildRss() — гарантия CDATA в content:encoded для IPB Importer - @astrojs/sitemap → sitemap-index.xml + sitemap.txt - 152-ФЗ cookie consent + privacy.astro + Analytics с gating - AI-файлы: robots.txt с явным allow для AI-краулеров, ai.txt, llms.txt - Гибридный визуал: фото-фон шапки (аэрофото Пушкино) + PT Serif + IBM Plex Sans - Иерархия: hero "Главная история" с рамкой + "Ещё из истории" + "Хроника" - Категория "main" (псевдо) скрыта из плашек и из Рубрик в сайдбаре - hideFromList: true для технических постов - featuredImage в frontmatter для постов без хорошей первой <img> - WP resized-URL (-WxH.ext) автоматически → оригинал - CI/CD: .gitea/workflows/deploy.yml (push → SSH-build) - Внешние RSS: scripts/pull-external-rss.mjs пишет news.json в bind-mount, фронт фетчит client-side
55 lines
1.7 KiB
YAML
55 lines
1.7 KiB
YAML
name: deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install SSH client
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y --no-install-recommends openssh-client
|
|
|
|
- name: Setup SSH
|
|
run: |
|
|
mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
|
printf '%s\n' "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/id_deploy
|
|
chmod 600 ~/.ssh/id_deploy
|
|
printf '%s\n' "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
|
|
chmod 644 ~/.ssh/known_hosts
|
|
|
|
- name: Deploy to web.hhivp.com
|
|
run: |
|
|
ssh -i ~/.ssh/id_deploy striker@web.hhivp.com bash -s <<'REMOTE'
|
|
set -euo pipefail
|
|
REPO_URL="https://${GITEA_USER}:${GITEA_TOKEN}@git.striker.su/striker/pushkinohistory-ru-v2.git"
|
|
DEPLOY_PATH="/opt/docker/sites/pushkinohistory-ru-v2"
|
|
HEALTH_URL="http://127.0.0.1:4146/"
|
|
|
|
if [ ! -d "$DEPLOY_PATH/.git" ]; then
|
|
mkdir -p "$DEPLOY_PATH"
|
|
git clone --branch main "$REPO_URL" "$DEPLOY_PATH"
|
|
else
|
|
cd "$DEPLOY_PATH"
|
|
git remote set-url origin "$REPO_URL"
|
|
git fetch origin main
|
|
git reset --hard origin/main
|
|
fi
|
|
|
|
cd "$DEPLOY_PATH"
|
|
mkdir -p data
|
|
docker compose build
|
|
docker compose up -d
|
|
sleep 5
|
|
docker compose ps
|
|
curl -fsS -o /dev/null -w "HEALTH HTTP %{http_code}\n" "$HEALTH_URL"
|
|
docker image prune -af --filter "until=168h" >/dev/null 2>&1 || true
|
|
REMOTE
|
|
env:
|
|
GITEA_USER: striker
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|