Test sync source retry
Pull develop branch / sync (push) Canceled after 0s

This commit is contained in:
2026-08-10 15:50:49 +07:00
parent 2d714c271c
commit 5e00d9b387
+10 -34
View File
@@ -1,44 +1,20 @@
name: Sync Source
name: Pull develop branch
on:
push:
branches:
- main
- develop
jobs:
sync-source:
runs-on: ubuntu-latest
container:
volumes:
- /data:/data
sync:
runs-on: docker
steps:
- uses: actions/checkout@v4
- name: Debug
run: |
pwd
ls -la /
ls -la /data
- name: Checkout develop branch
uses: actions/checkout@v3
with:
ref: develop
- name: Show mount
- name: Copy source to host
run: |
mount | grep data
df -h
ls -la /data
- name: Clone or Pull
env:
REPO_URL: https://gitea.digitoolsolutions.synology.me/lamtruong28/Test.git
TARGET_DIR: /data/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
rm -rf /workspace/*
cp -r $GITHUB_WORKSPACE/* /workspace/