From a0bd1fa3d2562f728ea272a8776a689d19d08336 Mon Sep 17 00:00:00 2001 From: Hamza Ahmed Date: Wed, 11 Mar 2026 11:33:10 +0000 Subject: [PATCH] added deploy wf --- .gitea/workflows/deploy.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..cb0f495 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,30 @@ +name: Deploy + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pandoc + run: sudo apt-get update && sudo apt-get install -y pandoc + + - name: Generate HTML + run: pandoc index.md -s -o index.html --css styles.css + + - name: Deploy to server via SSH + uses: appleboy/ssh-action@v1.2.0 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_KEY }} + port: ${{ secrets.SSH_PORT || '22' }} + script: | + cp /home/${{ secrets.SSH_USER }}/repo/index.html /usr/share/nginx/html/ + cp /home/${{ secrets.SSH_USER }}/repo/styles.css /usr/share/nginx/html/ + nginx -s reload