Skip to content

Commit 06bea05

Browse files
authored
dummy pr 6 (#124)
* Update package.json * remove defunct app * Update deploy-apps.yml * put main deployment under main in gh pages * Update deploy-apps.yml
1 parent 9ea4b09 commit 06bea05

File tree

5 files changed

+89
-143
lines changed

5 files changed

+89
-143
lines changed

.github/workflows/deploy-apps.yml

Lines changed: 78 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: Deploy Apps
22

33
on:
4-
push:
5-
branches: [ main ]
6-
paths:
7-
- '*/package.json'
8-
- '*/index.html'
9-
- '*/**'
4+
workflow_run:
5+
workflows: ["Test Apps"]
6+
types:
7+
- completed
8+
branches: [main]
109
pull_request:
1110
types: [opened, synchronize, reopened, closed]
1211
paths:
@@ -16,14 +15,18 @@ on:
1615

1716
jobs:
1817
build-and-deploy:
19-
if: github.event.action != 'closed'
18+
if: |
19+
(github.event_name == 'pull_request' && github.event.action != 'closed') ||
20+
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
2021
runs-on: ubuntu-latest
2122
permissions:
2223
contents: write
2324
pull-requests: write
2425

2526
steps:
2627
- uses: actions/checkout@v3
28+
with:
29+
ref: ${{ github.event.workflow_run.head_sha }}
2730

2831
- name: Set up Node.js
2932
uses: actions/setup-node@v3
@@ -33,20 +36,76 @@ jobs:
3336
- name: Install root dependencies
3437
run: npm install
3538

39+
- name: Show initial directory structure
40+
run: |
41+
echo "Current directory structure:"
42+
tree -L 3 || (apt-get update && apt-get install -y tree && tree -L 3)
43+
3644
- name: Build all apps
3745
run: |
3846
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
3947
npm run build pr-preview ${{ github.event.pull_request.number }}
48+
echo "PR Preview build output structure:"
49+
tree pr-preview -L 3
4050
else
4151
npm run build _site
52+
echo "_site build output structure:"
53+
tree _site -L 3
4254
fi
4355
4456
- name: Deploy to GitHub Pages
4557
uses: peaceiris/actions-gh-pages@v3
4658
with:
4759
github_token: ${{ secrets.GITHUB_TOKEN }}
4860
publish_dir: ${{ github.event_name == 'pull_request' && './pr-preview' || './_site' }}
49-
destination_dir: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || '.' }}
61+
destination_dir: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'main' }}
62+
keep_files: true
63+
enable_jekyll: false
64+
65+
- name: Create and deploy root index.html
66+
if: github.event_name != 'pull_request'
67+
run: |
68+
mkdir -p root
69+
cat > root/index.html << 'EOL'
70+
<!DOCTYPE html>
71+
<html>
72+
<head>
73+
<title>Pollinations Hive</title>
74+
<meta http-equiv="refresh" content="0; url=./main/" />
75+
<style>
76+
body {
77+
font-family: system-ui, -apple-system, sans-serif;
78+
max-width: 800px;
79+
margin: 2rem auto;
80+
padding: 0 1rem;
81+
line-height: 1.5;
82+
}
83+
a {
84+
color: #0366d6;
85+
text-decoration: none;
86+
}
87+
a:hover {
88+
text-decoration: underline;
89+
}
90+
</style>
91+
</head>
92+
<body>
93+
<h1>Pollinations Hive</h1>
94+
<p>Redirecting to <a href="./main/">main deployment</a>...</p>
95+
<script>
96+
window.location.href = './main/';
97+
</script>
98+
</body>
99+
</html>
100+
EOL
101+
102+
- name: Deploy root index
103+
if: github.event_name != 'pull_request'
104+
uses: peaceiris/actions-gh-pages@v3
105+
with:
106+
github_token: ${{ secrets.GITHUB_TOKEN }}
107+
publish_dir: ./root
108+
destination_dir: .
50109
keep_files: true
51110
enable_jekyll: false
52111

@@ -73,11 +132,21 @@ jobs:
73132
with:
74133
ref: gh-pages
75134

135+
- name: Show directory before cleanup
136+
run: |
137+
echo "Directory structure before cleanup:"
138+
tree -L 3 || (apt-get update && apt-get install -y tree && tree -L 3)
139+
76140
- name: Remove PR Preview
77141
run: |
78142
rm -rf pr-${{ github.event.pull_request.number }}
79143
git config user.name github-actions
80144
git config user.email github-actions@github.com
81145
git add .
82146
git commit -m "Remove PR preview for #${{ github.event.pull_request.number }}" || echo "No changes to commit"
83-
git push
147+
git push
148+
149+
- name: Show directory after cleanup
150+
run: |
151+
echo "Directory structure after cleanup:"
152+
tree -L 3 || (apt-get update && apt-get install -y tree && tree -L 3)

.github/workflows/update-apps-list.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,18 @@ jobs:
3030
# Get the app directory name
3131
app_dir=$(dirname "$app_path")
3232
app_name=$(basename "$app_dir")
33+
last_updated=$(git log -1 --format="%as" "$app_dir")
3334
3435
# Skip if it's the root directory
3536
if [ "$app_dir" = "." ]; then
3637
continue
3738
fi
3839
39-
# Get the last update date
40-
last_update=$(git log -1 --format="%ad" --date=short -- "$app_dir")
41-
4240
# Create the deployment URL (using GitHub Pages format)
43-
deploy_url="https://pollinations.github.io/hive/$app_name/"
41+
deploy_url="https://pollinations.github.io/hive/main/$app_name/"
4442
4543
# Add the app to the list
46-
echo "| [$app_name]($deploy_url) | [$app_dir]($app_dir) | $last_update |" >> apps_section.md
44+
echo "| [$app_name]($deploy_url) | [$app_dir]($app_dir) | $last_updated |" >> apps_section.md
4745
done
4846
4947
# Update README.md using awk for more precise section replacement

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ Welcome to Pollinations Hive - a revolutionary repository where AI meets collabo
77

88
| App | Source | Last Updated |
99
|-----|--------|--------------|
10-
| [llm-feedback](https://pollinations.github.io/hive/llm-feedback/) | [./llm-feedback](./llm-feedback) | 2025-01-14 |
11-
| [tarot-reader](https://pollinations.github.io/hive/tarot-reader/) | [./tarot-reader](./tarot-reader) | 2025-01-14 |
12-
| [pollinations-image-show](https://pollinations.github.io/hive/pollinations-image-show/) | [./pollinations-image-show](./pollinations-image-show) | 2025-01-14 |
13-
| [image-prompt](https://pollinations.github.io/hive/image-prompt/) | [./image-prompt](./image-prompt) | 2025-01-15 |
14-
| [graphics-editor](https://pollinations.github.io/hive/graphics-editor/) | [./graphics-editor](./graphics-editor) | 2025-01-15 |
15-
| [placeholder-generator](https://pollinations.github.io/hive/placeholder-generator/) | [./placeholder-generator](./placeholder-generator) | 2025-01-14 |
16-
| [ai-chat](https://pollinations.github.io/hive/ai-chat/) | [./ai-chat](./ai-chat) | 2025-01-15 |
10+
| [llm-feedback](https://pollinations.github.io/hive/main/llm-feedback/) | [./llm-feedback](./llm-feedback) | 2025-01-14 |
11+
| [tarot-reader](https://pollinations.github.io/hive/main/tarot-reader/) | [./tarot-reader](./tarot-reader) | 2025-01-14 |
12+
| [pollinations-image-show](https://pollinations.github.io/hive/main/pollinations-image-show/) | [./pollinations-image-show](./pollinations-image-show) | 2025-01-14 |
13+
| [image-prompt](https://pollinations.github.io/hive/main/image-prompt/) | [./image-prompt](./image-prompt) | 2025-01-15 |
14+
| [graphics-editor](https://pollinations.github.io/hive/main/graphics-editor/) | [./graphics-editor](./graphics-editor) | 2025-01-15 |
15+
| [placeholder-generator](https://pollinations.github.io/hive/main/placeholder-generator/) | [./placeholder-generator](./placeholder-generator) | 2025-01-14 |
16+
| [ai-chat](https://pollinations.github.io/hive/main/ai-chat/) | [./ai-chat](./ai-chat) | 2025-01-15 |
1717
## 📚 Documentation
1818

1919
### 🔍 Pull Request Previews

image-prompt/index.html

Lines changed: 0 additions & 121 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hive",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Collection of Pollinations apps",
55
"scripts": {
66
"test": "node scripts/test-apps.js",

0 commit comments

Comments
 (0)