From 15f99592290b284aeebfe14232143aa4ff34a518 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 21 Sep 2026 03:59:50 +0300 Subject: [PATCH] Deploy shanaty.ru/resume from Gitea Actions on every push to main Gitea runs .gitea/workflows instead of .github/workflows, so the GitHub Pages workflow of the GitHub copy stops running on the server (it built for GitHub Pages and could not deploy there anyway). ./deploy-shanaty.sh still works. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01XtcZtnG4GQA1d6mW5PNrS9 --- .gitea/workflows/deploy.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..05dc50c --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,40 @@ +# Builds the resume and publishes it at https://shanaty.ru/resume/ on every push to main (replaces ./deploy-shanaty.sh, which still works by hand). +# The text and the project list are NOT baked into the build: the page reads /data/resume.json, which the server keeps in step with data/resume.json +# in this repository. So a change that only touches data/ or the docs needs no rebuild. +# Gitea runs the workflows of .gitea/workflows INSTEAD of .github/workflows, so the GitHub Pages workflow of the GitHub copy does not run here. +name: deploy-shanaty +on: + push: + branches: [main] + paths-ignore: + - 'data/**' + - '*.md' +jobs: + deploy: + runs-on: ubuntu-latest + container: + image: docker.gitea.com/runner-images:ubuntu-latest + volumes: + - /opt/gitea/site:/site + steps: + - uses: actions/checkout@v4 + - name: Node + run: node --version && npm --version + - name: Install + run: npm ci + - name: Build + run: BASE_PATH=/resume NEXT_PUBLIC_DATA_URL=/data/resume.json NEXT_PUBLIC_SITE_ORIGIN= npm run build + - name: Check the build + run: test -f out/index.html + - name: Publish (the folder is swapped in, so the site is never half-updated) + run: | + set -e + cd /site + rm -rf .resume.new .resume.old + mkdir .resume.new + cp -r "$GITHUB_WORKSPACE"/out/. .resume.new/ + chmod -R a+rX .resume.new + if [ -d resume ]; then mv resume .resume.old; fi + mv .resume.new resume + rm -rf .resume.old + echo "Published: https://shanaty.ru/resume/"