forked from 1Panel-dev/appstore
-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (58 loc) · 2.25 KB
/
process-apps.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
64
65
66
67
68
69
70
71
72
73
name: Process Apps and Commit Changes
on:
workflow_dispatch:
schedule:
- cron: '0 */3 * * *'
jobs:
process:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml
- name: Run processing script
run: python process-apps.py
- name: Verify generated directories
run: |
ls -R appstore || echo "appstore not created"
ls -R dockge || echo "dockge not created"
- name: Configure Git
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git fetch origin custom
git add .
git diff --cached --quiet || git commit -m "Processed apps directory via GitHub Actions"
git rebase origin/custom || { echo "Rebase failed, trying to resolve"; git rebase --abort; git pull --rebase origin custom; }
git push origin custom
- name: Clone DPanel repository
run: |
git clone https://github.com/QYG2297248353/appstore-dpanel.git target-repo
- name: Copy appstore to DPanel repository
run: |
if [ -d "target-repo/apps" ]; then
rm -rf target-repo/apps
fi
mkdir -p target-repo/apps
rsync -a appstore/ target-repo/apps/
- name: Commit and push to DPanel repository
working-directory: target-repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add .
git diff --cached --quiet || git commit -m "Synced apps from source repository via GitHub Actions"
git push https://x-access-token:${{ secrets.GITHUBTOKEN }}@github.com/QYG2297248353/appstore-dpanel.git master