Files
Emil_Shanayev_Resume/deploy-shanaty.sh
T
EmilandClaude Sonnet 5 32c57a5ada
Deploy to GitHub Pages / build (push) Canceled after 0s
Deploy to GitHub Pages / deploy (push) Canceled after 0s
Resume site with live content from Gitea
Replaces the static portfolio with a resume site that reads /data/resume.json:
the text comes from data/resume.json in this repo, and the projects are the
public Gitea repos tagged `resume`. Merges in the content of the hh.ru resume
(backend/DevOps skills, experience, languages) without personal details.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 20:55:05 +03:00

33 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build the site and publish it at https://shanaty.ru/resume/ (Gitea/Caddy server).
#
# The text and project list are NOT baked into the build: the page reads /data/resume.json, which the
# server rebuilds every minute from data/resume.json in the Gitea repo plus the repos tagged `resume`.
# So redeploy only after changing code or styles; content changes just need a push to Gitea.
# The site is uploaded to a temp dir and swapped in, so it is never half-updated.
set -euo pipefail
cd "$(dirname "$0")"
HOST="${GT2GH_HOST:-root@135.106.198.222}"
KEY="${GT2GH_KEY:-$HOME/.ssh/MyGitea}"
SITE_DIR=/opt/gitea/site
[ -r "$KEY" ] || { echo "deploy: ssh key not found: $KEY" >&2; exit 1; }
rm -rf .next out
BASE_PATH=/resume NEXT_PUBLIC_DATA_URL=/data/resume.json npm run build
[ -f out/index.html ] || { echo "deploy: build failed (out/index.html missing)" >&2; exit 1; }
tar -C out -c . | ssh -i "$KEY" -o IgnoreUnknown=WarnWeakCrypto -o WarnWeakCrypto=no "$HOST" "
set -e
cd $SITE_DIR
rm -rf .resume.new .resume.old
mkdir .resume.new
tar -x -C .resume.new --no-same-owner
chmod -R a+rX .resume.new
if [ -d resume ]; then mv resume .resume.old; fi
mv .resume.new resume
rm -rf .resume.old
"
echo "Deployed: https://shanaty.ru/resume/"