Update create-app-structure.yml #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 a temporary directory | |
unzip -q humhub.zip -d humhub_temp | |
# Move all contents from the extracted 'humhub-1.17.0-beta.1' directory into 'app/' | |
mv humhub_temp/humhub-1.17.0-beta.1/* app/ | |
# Clean up by removing the temporary folder and the zip file | |
rm -rf humhub_temp | |
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 directly into app/" || echo "No changes to commit" | |
# Push the changes to the repository | |
git push origin main |