-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (53 loc) · 2.04 KB
/
ci_cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CI/CD Workflow
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.7' # Set your desired Python version
- name: Install dependencies for each subproject
run: |
# Loop through each subproject directory
for dir in projects/*; do
if [ -d "$dir" ]; then
echo "Installing dependencies for $dir"
# Check if requirements.txt exists in the subproject
if [ -f "$dir/requirements.txt" ]; then
pip install -r "$dir/requirements.txt"
else
echo "No requirements.txt found in $dir"
fi
fi
done
- name: Run README Generation
run: |
# Loop through each subproject directory to generate README files
for dir in projects/*; do
if [ -d "$dir" ]; then
project_name=$(basename "$dir")
readme_file="$dir/README.md"
# Create a README file with documentation
echo "# $project_name" > "$readme_file"
echo "" >> "$readme_file"
echo "## Description" >> "$readme_file"
echo "This is the README for the $project_name project." >> "$readme_file"
echo "" >> "$readme_file"
echo "## Installation" >> "$readme_file"
echo "To install the dependencies, run the following command:" >> "$readme_file"
echo "\`\`\`bash" >> "$readme_file"
echo "pip install -r requirements.txt" >> "$readme_file"
echo "\`\`\`" >> "$readme_file"
echo "" >> "$readme_file"
echo "## Usage" >> "$readme_file"
echo "Instructions for using the $project_name project go here." >> "$readme_file"
echo "Generated README for $project_name"
fi
done