-
Notifications
You must be signed in to change notification settings - Fork 10
106 lines (93 loc) · 2.79 KB
/
gh-pages.yml
File metadata and controls
106 lines (93 loc) · 2.79 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Deploy Explorer
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Generate dataset
run: |
mkdir -p build web/public
python scripts/generate_data_bundle.py --out build/data.json --public web/public/data.json || true
- name: Check if web directory exists
id: check_web
run: |
if [ -d "web" ] && [ -f "web/package.json" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Set up Node.js
if: steps.check_web.outputs.exists == 'true'
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/package-lock.json
- name: Install dependencies
if: steps.check_web.outputs.exists == 'true'
working-directory: web
run: npm install
- name: Build site
if: steps.check_web.outputs.exists == 'true'
working-directory: web
run: npm run build
- name: Create placeholder page
if: steps.check_web.outputs.exists == 'false'
run: |
mkdir -p web/dist
cat > web/dist/index.html << 'EOF'
<!DOCTYPE html>
<html>
<head>
<title>UIBloatwareRegistry Explorer - Coming Soon</title>
<style>
body { font-family: system-ui; max-width: 800px; margin: 50px auto; padding: 20px; }
h1 { color: #333; }
p { line-height: 1.6; color: #666; }
a { color: #0066cc; }
</style>
</head>
<body>
<h1>UIBloatwareRegistry Explorer</h1>
<p>The web interface is currently under development.</p>
<p>Visit the <a href="https://github.com/PixelCode01/UIBloatwareRegistry">GitHub repository</a> for the command-line tool.</p>
</body>
</html>
EOF
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: web/dist
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Configure Pages
id: config
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4