From 6fb326d69a2bba88187eab527c9521d31551ca6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E9=A3=8E?= Date: Fri, 1 May 2026 11:17:39 +0800 Subject: [PATCH] add action --- .gitea/workflows/sync-to-host.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .gitea/workflows/sync-to-host.yml diff --git a/.gitea/workflows/sync-to-host.yml b/.gitea/workflows/sync-to-host.yml new file mode 100644 index 0000000..70e57bc --- /dev/null +++ b/.gitea/workflows/sync-to-host.yml @@ -0,0 +1,31 @@ +name: Sync To /home/ubuntu/gfps + +on: + push: + paths: + - "**/*.md" + workflow_dispatch: + +jobs: + sync: + runs-on: gfps + steps: + - name: Sync repo + shell: bash + run: | + set -e + TARGET=/home/ubuntu/gfps + REPO="http://oauth2:${{ gitea.token }}@172.17.0.1:3000/${{ github.repository }}.git" + + mkdir -p "$TARGET" + cd "$TARGET" + + if [ ! -d .git ]; then + git clone "$REPO" . + else + git remote set-url origin "$REPO" + fi + + git fetch --prune origin + git reset --hard "${{ github.sha }}" + git clean -fd \ No newline at end of file