Skip to content

Commit

Permalink
Create create-app-structure.yml
Browse files Browse the repository at this point in the history
Signed-off-by: ArchBlood <35392110+ArchBlood@users.noreply.github.com>
  • Loading branch information
ArchBlood authored Nov 6, 2024
1 parent ee1618b commit 980fb99
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/create-app-structure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Create App Structure

# Trigger the action on push or pull_request to the main branch
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
create-structure:
runs-on: ubuntu-latest

# Explicit permissions for the workflow to write to the repository
permissions:
contents: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install tree command
run: sudo apt-get install -y tree

- name: Create app directories and files
run: |
# Create directories
mkdir -p app/{config,modules,protected/runtime,static,protected/vendor}
# Create basic configuration files
touch app/.env app/config/db.php app/config/web.php
# Create basic module and protected files
mkdir -p app/modules/custom_module
touch app/modules/custom_module/Module.php
mkdir -p app/protected/controllers
touch app/protected/controllers/IndexController.php
mkdir -p app/protected/models
touch app/protected/models/User.php
mkdir -p app/protected/views/site
touch app/protected/views/site/index.php
# Create static directories for assets
mkdir -p app/static/css app/static/js app/static/images
# Create vendor file (it will be populated later by Composer)
touch app/protected/vendor/.gitkeep
# Output structure for confirmation
echo "App structure created successfully"
tree app/
- name: Commit and push changes (if any)
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add app/
git commit -m "Create initial app structure" || echo "No changes to commit"
git push origin main

0 comments on commit 980fb99

Please sign in to comment.