Files
tibi-docs/.gitea/workflows/deploy.yml
T
apairon bda5d80180
Deploy tibi-docs / build-and-deploy (push) Successful in 27s
Deploy auf live: docs.tibicms.de per Repo-Token-Rsync
- Workflow auf master-only reduziert: build + rsync ./dist/ (kein Registry/Staging)
- rsync-Ziel ueber RSYNC_PATH=docs.tibicms.de (Docroot ab htdocs), User Repo+Subdomain-ID
- sshpass -e statt Passwort im Kommando
- astro site-URL auf https://docs.tibicms.de umgestellt (Sitemap/Canonical)
- docker-compose-staging.yml entfernt (Staging raus)
2026-10-20 14:11:35 +00:00

76 lines
2.6 KiB
YAML

name: Deploy tibi-docs
# Statischer Starlight-Build, Auslieferung als Dateien über Apache.
# Push auf master -> Build -> rsync nach htdocs/<RSYNC_PATH>/ auf ftp1.webmakers.de.
# Auth: Repo-Token (github.token) + Basispanel-Subdomain docs.tibicms.de (ID 2216,
# gitbaseRepository=cms/tibi-docs). Der rsync-User landet in htdocs des Kunden;
# weiter runter kommt man nicht, deshalb ist RSYNC_PATH der Docroot-Pfad ab htdocs.
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, RSYNC_PATH = Docroot ab htdocs.
- name: deploy-live
env:
RSYNC_USER: ${{ github.repository }},2216
RSYNC_PASS: ${{ github.token }}
RSYNC_HOST: ftp1.webmakers.de
RSYNC_PORT: "22223"
RSYNC_PATH: docs.tibicms.de
run: |
set -eu
: "${RSYNC_USER:?RSYNC_USER missing}"
: "${RSYNC_PASS:?RSYNC_PASS missing}"
: "${RSYNC_HOST:?RSYNC_HOST missing}"
: "${RSYNC_PORT:?RSYNC_PORT missing}"
: "${RSYNC_PATH:?RSYNC_PATH missing}"
echo "Deploying to ${RSYNC_HOST}:${RSYNC_PATH} 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}":"./${RSYNC_PATH}/"