From cfed6c0dde7b2418ff8263f87b3cf4fdd05d2fab Mon Sep 17 00:00:00 2001 From: ~purplebored Date: Thu, 30 Oct 2025 23:02:26 +0100 Subject: [PATCH] Add a deploy action --- .gitea/workflows/deploy.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 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..e7c8560 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,29 @@ +name: Deploy Website + +on: + push: + branches: + - rewrite-static + +jobs: + deploy: + runs-on: self-hosted + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up SSH key + run: | + mkdir -p ~/.ssh + echo "${DEPLOY_KEY}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -H "${DEPLOY_HOST}" >> ~/.ssh/known_hosts + + - name: Deploy website with rsync + run: | + rsync -avz --delete ./ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH} + env: + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + DEPLOY_USER: ${{ secrets.DEPLOY_USER }} + DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}