Files
haemka.de/.gitea/workflows/build-deploy.yml
T
haemka 88bed173c1
Build and deploy / build-and-deploy (push) Failing after 19s
Install nodejs in workflow container so actions/checkout can run
python:3.12-slim has no Node.js; JS-based actions like actions/checkout
need it to execute their bundled dist/index.js.
2026-08-13 15:03:49 +00:00

43 lines
1.2 KiB
YAML

name: Build and deploy
on:
push:
branches: [master]
workflow_dispatch: {}
jobs:
build-and-deploy:
runs-on: self-hosted
container: python:3.12-slim
steps:
- name: Install system dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends git rsync openssh-client nodejs
- name: Checkout (incl. theme submodule)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Python dependencies
run: pip install --no-cache-dir -r requirements.txt
- name: Build site
run: pelican -s publishconf.py
- name: Deploy via rsync
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
run: |
mkdir -p ~/.ssh
printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts 2>/dev/null
rsync -avz --delete \
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=yes" \
output/ "${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}"