add action
This commit is contained in:
31
.gitea/workflows/sync-to-host.yml
Normal file
31
.gitea/workflows/sync-to-host.yml
Normal 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
|
||||
Reference in New Issue
Block a user