@@ -1,4 +1,4 @@
|
|||||||
name: Sync Source new
|
name: Sync Source
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -7,12 +7,22 @@ on:
|
|||||||
- develop
|
- develop
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Clone or Pull
|
||||||
- name: Test mount
|
env:
|
||||||
|
REPO_URL: https://gitea.digitoolsolutions.synology.me/lamtruong28/Test.git
|
||||||
|
TARGET_DIR: /workspace/Test
|
||||||
|
BRANCH: develop
|
||||||
run: |
|
run: |
|
||||||
touch /workspace-storage/test.txt
|
if [ ! -d "$TARGET_DIR/.git" ]; then
|
||||||
ls -la /workspace-storage
|
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
|
||||||
Reference in New Issue
Block a user