Skip to content

Commit 3067f62

Browse files
committed
fix: fixed the issue of missing .git directory
1 parent 5967517 commit 3067f62

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-1
lines changed

.github/actions/deploy-code/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
description: 'Application directory name'
2222
required: true
2323

24+
repository-url:
25+
description: 'Git repository URL'
26+
required: false
27+
2428
runs:
2529
using: 'composite'
2630
steps:
@@ -40,6 +44,13 @@ runs:
4044
echo "${{ inputs.env-file }}" > .env
4145
echo "✓ Environment file created"
4246
47+
#Initialize the git if ,git doesn't exsits
48+
if [ ! -d .git ]; then
49+
git init
50+
git remote add origin ${{ inputs.repository-url }}
51+
52+
fi
53+
4354
# Ensure we're on the right branch
4455
git reset --hard HEAD
4556
git clean -fd

.github/actions/deploy-to-server/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ inputs:
2828
description: 'Application directory name'
2929
required: true
3030

31+
repository-url:
32+
description: 'Git repository URL'
33+
required: false
34+
3135

3236

3337
runs:
@@ -51,6 +55,7 @@ runs:
5155
env-file: ${{ inputs.env-file }}
5256
branch: ${{ inputs.branch }}
5357
app-directory: ${{ inputs.app-directory }}
58+
repository-url: ${{ inputs.repository-url }}
5459

5560

5661
- name: Setup Python Environment

.github/actions/setup-dependencies/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ runs:
4646
else
4747
echo "❌ Directory '${{ inputs.app-directory }}' does not exist"
4848
mkdir -p $HOME/${{ inputs.app-directory }}
49+
echo "🙂Created required directory!!!"
4950
fi

.github/actions/setup-python-env/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ inputs:
1515
description: 'Application directory name'
1616
required: true
1717

18+
repository-url:
19+
description: 'Git repository URL'
20+
required: false
21+
1822
runs:
1923
using: 'composite'
2024
steps:

.github/workflows/dev-deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ jobs:
2828
ssh-key: ${{ secrets.LINUX_ONE_VM_SSH_KEY }}
2929
env-file: ${{ secrets.ENV_FILE }}
3030
branch: 'main'
31-
app-directory: 'Bank-Statment-Anaylser-main'
31+
app-directory: 'Bank-Statment-Anaylser-main'
32+
repository-url: 'https://github.com/Benji918/Bank-Statment-Anaylser.git'

0 commit comments

Comments
 (0)