Files
ahmza-dad/.gitea/workflows/deploy.yml
T
Hamza Ahmed f640d2e403
Deploy / deploy (push) Failing after 9s
attempting with scp
2026-03-11 11:51:59 +00:00

37 lines
1.0 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
run: apt-get update && apt-get install -y pandoc
- 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 SCP
run: |
scp -P ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
index.html styles.css nginx.conf \
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/usr/share/nginx/html/
- name: Reload nginx
run: |
ssh -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
"nginx -s reload"