Files
gfps/.gitea/workflows/sync-to-host.yml
魏风 c95e9d2a07
All checks were successful
Sync To /home/ubuntu/.nanobot/workspace/gfps / sync (push) Successful in 1s
修改cicd 生成的文档指向 /home/ubuntu/.nanobot/workspace/gfps
2026-05-01 22:31:16 +08:00

31 lines
682 B
YAML

name: Sync To /home/ubuntu/.nanobot/workspace/gfps
on:
push:
paths:
- "**/*.md"
workflow_dispatch:
jobs:
sync:
runs-on: gfps
steps:
- name: Sync repo
shell: bash
run: |
set -e
TARGET=/home/ubuntu/.nanobot/workspace/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