Files
stAndrews/.gitea/workflows/deploy.yaml
Workflow config file is invalid. Please check your config file: yaml: line 33: could not find expected ':'

34 lines
950 B
YAML

name: Deploy stAndrews
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
container:
image: debian:bookworm-slim
steps:
- name: Install SSH client
run: apt-get update -y && apt-get install -y --no-install-recommends openssh-client
- name: Deploy via SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
SERVER_IP: ${{ secrets.DEPLOY_SERVER_IP }}
SERVER_USER: ${{ secrets.DEPLOY_SERVER_USER }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H $SERVER_IP >> ~/.ssh/known_hosts
ssh ${SERVER_USER}@${SERVER_IP} << 'EOF'
cd /data/projects/r/stAndrews
git pull
docker compose up -d --build
docker exec analytics-gateway caddy reload --config /etc/caddy/Caddyfile --adapter caddyfile
EOF