add action

This commit is contained in:
魏风
2026-05-01 11:17:39 +08:00
parent e29d75e367
commit 6fb326d69a

View File

@@ -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