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"