From a68f854aa24b5c948d097b232c62d87e51c5a8cd Mon Sep 17 00:00:00 2001 From: DoctoDre Date: Mon, 27 Jul 2026 16:20:43 +0200 Subject: [PATCH] ci(andreknie.de): add Gitea Actions deploy --- .gitea/workflows/deploy-andreknie.yml | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .gitea/workflows/deploy-andreknie.yml diff --git a/.gitea/workflows/deploy-andreknie.yml b/.gitea/workflows/deploy-andreknie.yml new file mode 100644 index 0000000..95cc9ef --- /dev/null +++ b/.gitea/workflows/deploy-andreknie.yml @@ -0,0 +1,72 @@ +name: Deploy andreknie.de + +on: + push: + branches: + - feat/federation-setup + paths: + - ".gitea/workflows/deploy-andreknie.yml" + - "privat/CV/andreknie.de/**" + +jobs: + deploy: + runs-on: ubuntu-latest + container: + image: node:20-bookworm + env: + DEPLOY_HOST: "217.160.174.2" + DEPLOY_USER: "root" + DEPLOY_PATH: "/opt/andreknie" + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install deploy tools + run: | + apt-get update -qq + apt-get install -y openssh-client rsync + + - name: Build frontend + run: | + cd privat/CV/andreknie.de + npm ci + npm run build + + - name: Configure SSH + env: + VPS_SSH_KEY: ${{ secrets.VPS_SSH_KEY }} + run: | + install -d -m 700 ~/.ssh + printf '%s\n' "$VPS_SSH_KEY" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + ssh-keyscan -H "$DEPLOY_HOST" > ~/.ssh/known_hosts + chmod 600 ~/.ssh/known_hosts + + - name: Write production environment + working-directory: privat/CV/andreknie.de + env: + SMTP_HOST: ${{ secrets.SMTP_HOST }} + SMTP_USER: ${{ secrets.SMTP_USER }} + SMTP_PASS: ${{ secrets.SMTP_PASS }} + run: | + cat > .env </dev/null 2>&1; then caddy validate --config /etc/caddy/Caddyfile && systemctl reload caddy; fi"