-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (127 loc) · 4.48 KB
/
deploy.yml
File metadata and controls
142 lines (127 loc) · 4.48 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Deploy RSS Feeds to GitHub Pages
on:
push:
branches: [ main, master ]
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Create site structure
run: |
# Create the site directory structure
mkdir -p _site/feeds
# Copy index.html if it exists, otherwise create a basic one
if [ -f "index.html" ]; then
cp index.html _site/
else
cat > _site/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RSS Feeds</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
max-width: 900px;
margin: 0 auto;
padding: 20px;
line-height: 1.6;
background-color: #f8f9fa;
}
.header {
text-align: center;
margin-bottom: 40px;
padding: 20px;
background: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.feed {
margin: 20px 0;
padding: 20px;
background: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.feed-title {
font-size: 1.3em;
font-weight: 600;
margin-bottom: 10px;
color: #2c3e50;
}
.feed-url a {
color: #3498db;
text-decoration: none;
}
.updated {
color: #95a5a6;
font-size: 0.9em;
text-align: center;
margin-top: 40px;
padding: 20px;
background: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
</style>
</head>
<body>
<div class="header">
<h1>🎯 RSS Feed Collection</h1>
</div>
<div class="feed">
<div class="feed-title">RSS Feeds</div>
<p>RSS feed files will appear here when uploaded.</p>
</div>
<div class="updated">
Last updated: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
</div>
</body>
</html>
EOF
fi
# Copy all XML/RSS feed files to the feeds directory
if ls feeds/*.xml 1> /dev/null 2>&1; then
cp feeds/*.xml _site/feeds/
fi
if ls feeds/*.rss 1> /dev/null 2>&1; then
cp feeds/*.rss _site/feeds/
fi
# Copy any other feed files that might exist
if [ -d "feeds" ]; then
find feeds -type f \( -name "*.xml" -o -name "*.rss" -o -name "*.atom" -o -name "*.json" \) -exec cp {} _site/feeds/ \;
fi
# List what we're deploying
echo "Site contents:"
find _site -type f | sort
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4