Files
ahmza-dad/.gitea/workflows/deploy.yml
T
Hamza Ahmed b969e6a3a4
Deploy / deploy (push) Failing after 11s
wf will also download rsync
2026-03-11 11:46:04 +00:00

39 lines
1.1 KiB
YAML

name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pandoc and rsync
run: sudo apt-get update && sudo apt-get install -y pandoc rsync
- name: Generate HTML
run: pandoc index.md -s -o index.html --css styles.css
- name: Setup SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
- name: Deploy to server via rsync
run: |
rsync -avz --delete \
-e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
--exclude='.git' \
index.html styles.css nginx.conf \
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/usr/share/nginx/html/
- name: Reload nginx
run: |
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
"nginx -s reload"