Deploy shanaty.ru/resume from Gitea Actions on every push to main
deploy-shanaty / deploy (push) Successful in 54s
deploy-shanaty / deploy (push) Successful in 54s
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtcZtnG4GQA1d6mW5PNrS9
This commit is contained in:
@@ -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/"
|
||||
Reference in New Issue
Block a user