Skip to content

Commit 7466a28

Browse files
authored
Create create_project_ structure.yml
1 parent d6e7f76 commit 7466a28

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Create app project structure from template
2+
3+
on:
4+
push:
5+
paths:
6+
- "add_apps.json"
7+
8+
jobs:
9+
process-apps:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: "14"
20+
21+
- name: Install jq
22+
run: sudo apt-get install jq
23+
24+
- name: Process add_apps.json
25+
run: |
26+
mkdir -p apps
27+
for row in $(jq -c '.[]' add_apps.json); do
28+
name=$(echo $row | jq -r '.name')
29+
if [ ! -d "apps/$name" ]; then
30+
cp -r template "apps/$name"
31+
echo $row | jq '.' > "apps/$name/variables.json"
32+
sed -i "s/W9_ID/$name/g" "apps/$name/.env"
33+
fi
34+
done
35+
36+
- name: Commit and push changes
37+
uses: stefanzweifel/git-auto-commit-action@v4
38+
with:
39+
commit_message: Create app project structure from template

0 commit comments

Comments
 (0)