Skip to content

Update create-app-structure.yml #3

Update create-app-structure.yml

Update create-app-structure.yml #3

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@v4
- name: Install dependencies
run: |
# Install curl and unzip to handle the HumHub package download and extraction
sudo apt-get update
sudo apt-get install -y curl unzip
- name: Download and unzip HumHub
run: |
# Download HumHub zip file from the official site
curl -L https://download.humhub.com/downloads/install/humhub-1.17.0-beta.1.zip -o humhub.zip
# Unzip the package into the 'app' directory (preserving the HumHub structure)
unzip -q humhub.zip -d app/
# Remove the zip file after extraction
rm humhub.zip
- name: Output the directory structure
run: |
# Output the structure of the 'app/' directory for confirmation
echo "App structure created successfully"
tree app/
- name: Commit and push changes (if any)
run: |
# Configure git user
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# Add and commit any changes (including the unzipped HumHub content)
git add app/
git commit -m "Unzip HumHub files into app/" || echo "No changes to commit"
# Push the changes to the repository
git push origin main