Files
tibi-docs/.gitea/workflows/deploy.yml
T
apairon fe3818612b
Deploy tibi-docs / build-and-deploy (push) Successful in 23s
Deploy-Ziel korrigiert: rsync-Chroot ist der Docroot
Der Repo-Rsync landet direkt im Docroot der Subdomain, nicht im Kunden-htdocs.
Ziel ist deshalb ./, ein Unterpfad docs.tibicms.de war doppelt.
2026-10-20 14:13:13 +00:00

74 lines
2.5 KiB
YAML

name: Deploy tibi-docs
# Statischer Starlight-Build, Auslieferung als Dateien über Apache.
# Push auf master -> Build -> rsync ./dist/ nach ftp1.webmakers.de, Ziel ./.
# Auth: Repo-Token (github.token) + Basispanel-Subdomain docs.tibicms.de (ID 2216,
# gitbaseRepository=cms/tibi-docs). Das rsync-Chroot ist der Docroot der Subdomain
# (/docs.tibicms.de), deshalb landet "./" direkt im Webroot.
on:
push:
branches:
- master
jobs:
deploy:
name: build-and-deploy
runs-on: ubuntu-latest
container:
image: gitbase.de/actions/ubuntu:latest
env:
FORCE_COLOR: "true"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: true
submodules: false
- name: setup-node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: install-dependencies
run: npm ci
- name: build-static
run: npm run build
- name: check-static-build
run: |
set -eu
test -f dist/index.html
test -f dist/404.html
test -d dist/pagefind
# .env ist gitignored -> Zielwerte stehen hier direkt (keine Secrets).
# RSYNC_USER = Repo + Basispanel-Subdomain-ID; "./" ist der Docroot.
- name: deploy-live
env:
RSYNC_USER: ${{ github.repository }},2216
RSYNC_PASS: ${{ github.token }}
RSYNC_HOST: ftp1.webmakers.de
RSYNC_PORT: "22223"
run: |
set -eu
: "${RSYNC_USER:?RSYNC_USER missing}"
: "${RSYNC_PASS:?RSYNC_PASS missing}"
: "${RSYNC_HOST:?RSYNC_HOST missing}"
: "${RSYNC_PORT:?RSYNC_PORT missing}"
echo "Deploying to ${RSYNC_HOST} (docroot docs.tibicms.de) on port ${RSYNC_PORT} as ${RSYNC_USER}"
export SSHPASS="${RSYNC_PASS}"
SSH_CMD="sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${RSYNC_PORT} -l ${RSYNC_USER}"
rsync -rlcgD --perms -i -u -v --stats --progress \
--delete \
-e "${SSH_CMD}" \
--exclude=.git \
./dist/ "${RSYNC_HOST}":"./"