From f40688ae40a68bdb20c38ae5b404533752436108 Mon Sep 17 00:00:00 2001 From: lamtruong28 Date: Mon, 10 Aug 2026 14:59:57 +0700 Subject: [PATCH] Test Sync --- .gitea/workflows/sync-source.yaml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/sync-source.yaml b/.gitea/workflows/sync-source.yaml index 24d40e9..7e6af73 100644 --- a/.gitea/workflows/sync-source.yaml +++ b/.gitea/workflows/sync-source.yaml @@ -1,4 +1,4 @@ -name: Sync Source new +name: Sync Source on: push: @@ -7,12 +7,22 @@ on: - develop jobs: - sync: + deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Test mount + - name: Clone or Pull + env: + REPO_URL: https://gitea.digitoolsolutions.synology.me/lamtruong28/Test.git + TARGET_DIR: /workspace/Test + BRANCH: develop run: | - touch /workspace-storage/test.txt - ls -la /workspace-storage \ No newline at end of file + 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 \ No newline at end of file