From 409f02053d99037d2554e872b29166754066f71a Mon Sep 17 00:00:00 2001 From: masiv_ Date: Wed, 4 Feb 2026 13:37:46 -0300 Subject: [PATCH] Create website sync --- .gitea/workflows/website-sync.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .gitea/workflows/website-sync.yaml diff --git a/.gitea/workflows/website-sync.yaml b/.gitea/workflows/website-sync.yaml new file mode 100644 index 0000000..c4a5186 --- /dev/null +++ b/.gitea/workflows/website-sync.yaml @@ -0,0 +1,26 @@ +name: Website Sync +run-name: Git to server sync +on: [push] + +jobs: + website-sync: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup SSH agent and deploy + run: | + eval "$(ssh-agent -s)" + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + chmod 700 ~/.ssh + ssh-keyscan "$SSH_HOST" >> ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts + + ssh "$SSH_USER@$SSH_HOST" "cd $SSH_WEBSITE_LOCATION && git stash && git pull --force origin master" + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + SSH_USER: ${{ secrets.SSH_USER }} + SSH_HOST: ${{ secrets.SSH_HOST }} + SSH_WEBSITE_LOCATION: ${{ secrets.SSH_WEBSITE_LOCATION }} \ No newline at end of file