Files
Test/.gitea/workflows/sync-source.yaml
T
lamtruong28 f40688ae40
Sync Source / deploy (push) Successful in 21s
Test Sync
2026-08-10 14:59:57 +07:00

28 lines
729 B
YAML

name: Sync Source
on:
push:
branches:
- main
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Clone or Pull
env:
REPO_URL: https://gitea.digitoolsolutions.synology.me/lamtruong28/Test.git
TARGET_DIR: /workspace/Test
BRANCH: develop
run: |
if [ ! -d "$TARGET_DIR/.git" ]; then
echo "Repository does not exist. Cloning..."
git clone -b $BRANCH $REPO_URL $TARGET_DIR
else
echo "Repository already exists. Pulling..."
git -C $TARGET_DIR fetch origin
git -C $TARGET_DIR checkout $BRANCH
git -C $TARGET_DIR reset --hard origin/$BRANCH
fi