@@ -0,0 +1,30 @@
|
|||||||
|
name: Sync Source to Host
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
jobs:
|
||||||
|
sync-source:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Sync repository
|
||||||
|
run: |
|
||||||
|
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
REPO_NAME=$(basename "${GITHUB_REPOSITORY}")
|
||||||
|
TARGET_DIR="/data/${REPO_NAME}"
|
||||||
|
BRANCH="${GITHUB_REF_NAME}"
|
||||||
|
|
||||||
|
if [ ! -d "$TARGET_DIR/.git" ]; then
|
||||||
|
echo "Cloning repository..."
|
||||||
|
git clone -b "$BRANCH" "$REPO_URL" "$TARGET_DIR"
|
||||||
|
else
|
||||||
|
echo "Updating repository..."
|
||||||
|
git -C "$TARGET_DIR" fetch origin "$BRANCH"
|
||||||
|
git -C "$TARGET_DIR" checkout "$BRANCH"
|
||||||
|
git -C "$TARGET_DIR" reset --hard "origin/$BRANCH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Current commit:"
|
||||||
|
git -C "$TARGET_DIR" log --oneline -1
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Welcome to Simulators</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Welccom to DTS Team</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user