-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.85 KB
/
create-app-structure.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
62
63
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