This commit is contained in:
@@ -1,19 +1,41 @@
|
|||||||
name: Pull develop branch
|
name: Sync Source
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- main
|
||||||
- develop
|
- develop
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
sync-source:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout develop branch
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- name: Debug
|
||||||
with:
|
run: |
|
||||||
ref: develop
|
pwd
|
||||||
- name: Prepare output folder
|
ls -la /
|
||||||
run: mkdir -p /output
|
ls -la /data
|
||||||
- name: Copy to host folder
|
|
||||||
run: cp -r $GITHUB_WORKSPACE/* /output/
|
- name: Show mount
|
||||||
|
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: /output/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
|
||||||
Reference in New Issue
Block a user