Skip to content

Commit cbc40ac

Browse files
committed
Better style and CI actions.
1 parent 03e561b commit cbc40ac

6 files changed

Lines changed: 758 additions & 15 deletions

File tree

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
name: Build and Deploy Songbook
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.11'
33+
34+
- name: Install TeX Live
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y \
38+
texlive-latex-base \
39+
texlive-latex-extra \
40+
texlive-fonts-recommended \
41+
texlive-fonts-extra \
42+
texlive-xetex \
43+
latexmk
44+
45+
- name: Install Python dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install git+https://github.com/carmiac/openlyric_bookmaker.git
49+
50+
- name: Build songbook
51+
run: |
52+
openlyric_bookmaker --config book_config.toml
53+
54+
- name: Create GitHub Pages structure
55+
run: |
56+
mkdir -p gh-pages
57+
# Copy HTML output
58+
cp -r output/html/* gh-pages/
59+
# Copy PDFs
60+
mkdir -p gh-pages/pdfs
61+
cp output/pdfs/*.pdf gh-pages/pdfs/ || true
62+
# Create landing page
63+
cat > gh-pages/downloads.html << 'EOF'
64+
<!DOCTYPE html>
65+
<html lang="en">
66+
<head>
67+
<meta charset="UTF-8">
68+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
69+
<title>The Swilling Swede's Songbook - Downloads</title>
70+
<link rel="stylesheet" href="stylesheets/custom-theme.css">
71+
<style>
72+
body {
73+
font-family: Georgia, 'Times New Roman', serif;
74+
margin: 0;
75+
padding: 0;
76+
background: linear-gradient(135deg, #FFF8E7 0%, #FFE4B5 100%);
77+
min-height: 100vh;
78+
}
79+
.container {
80+
max-width: 900px;
81+
margin: 0 auto;
82+
padding: 40px 20px;
83+
}
84+
.header {
85+
text-align: center;
86+
background: linear-gradient(135deg, #8B0000 0%, #5C0000 100%);
87+
color: #D4AF37;
88+
padding: 60px 20px;
89+
border-radius: 10px;
90+
box-shadow: 0 8px 16px rgba(139, 0, 0, 0.3);
91+
margin-bottom: 40px;
92+
border: 3px solid #D4AF37;
93+
}
94+
.header h1 {
95+
margin: 0 0 20px 0;
96+
font-size: 3em;
97+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
98+
}
99+
.header p {
100+
font-size: 1.2em;
101+
font-style: italic;
102+
margin: 10px 0;
103+
color: #F4D03F;
104+
}
105+
.section {
106+
background: white;
107+
padding: 30px;
108+
border-radius: 10px;
109+
margin-bottom: 30px;
110+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
111+
border-left: 5px solid #D4AF37;
112+
}
113+
.section h2 {
114+
color: #8B0000;
115+
border-bottom: 3px solid #D4AF37;
116+
padding-bottom: 10px;
117+
margin-top: 0;
118+
}
119+
.button-group {
120+
display: grid;
121+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
122+
gap: 20px;
123+
margin-top: 20px;
124+
}
125+
.btn {
126+
display: inline-block;
127+
padding: 15px 30px;
128+
background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
129+
color: #D4AF37;
130+
text-decoration: none;
131+
border-radius: 5px;
132+
text-align: center;
133+
font-weight: bold;
134+
font-size: 1.1em;
135+
transition: all 0.3s ease;
136+
border: 2px solid #D4AF37;
137+
box-shadow: 0 4px 6px rgba(139, 0, 0, 0.3);
138+
}
139+
.btn:hover {
140+
background: linear-gradient(135deg, #DC143C 0%, #8B0000 100%);
141+
transform: translateY(-3px);
142+
box-shadow: 0 6px 12px rgba(139, 0, 0, 0.4);
143+
color: #F4D03F;
144+
}
145+
.btn-primary {
146+
grid-column: 1 / -1;
147+
background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
148+
color: #5C0000;
149+
border: 2px solid #8B0000;
150+
}
151+
.btn-primary:hover {
152+
background: linear-gradient(135deg, #F4D03F 0%, #D4AF37 100%);
153+
color: #8B0000;
154+
}
155+
.description {
156+
color: #5C4033;
157+
line-height: 1.8;
158+
margin: 15px 0;
159+
}
160+
.footer {
161+
text-align: center;
162+
padding: 30px;
163+
color: #5C4033;
164+
font-style: italic;
165+
}
166+
.icon {
167+
margin-right: 10px;
168+
font-size: 1.2em;
169+
}
170+
</style>
171+
</head>
172+
<body>
173+
<div class="container">
174+
<div class="header">
175+
<h1>🍺 The Swilling Swede's Songbook 🍺</h1>
176+
<p>A collection of songs humbly presented for your amusement</p>
177+
<p>Preferably around a campfire while drinking mead, scotch, beer, or rum</p>
178+
<p>And surrounded by good company</p>
179+
</div>
180+
181+
<div class="section">
182+
<h2>📖 Browse Online</h2>
183+
<p class="description">
184+
View the complete songbook in your browser with our interactive HTML version.
185+
Perfect for quick reference and searching.
186+
</p>
187+
<div class="button-group">
188+
<a href="index.html" class="btn btn-primary">
189+
<span class="icon">🎵</span>View Songbook Online
190+
</a>
191+
</div>
192+
</div>
193+
194+
<div class="section">
195+
<h2>📥 Download PDFs</h2>
196+
<p class="description">
197+
Download the songbook in various PDF formats for different purposes.
198+
All versions contain the same songs, just formatted differently.
199+
</p>
200+
<div class="button-group">
201+
<a href="pdfs/SwillingSwedesSongbook-BoundPrint.pdf" class="btn">
202+
<span class="icon">📕</span>Bound Print Version
203+
</a>
204+
<a href="pdfs/SwillingSwedesSongbook-Display.pdf" class="btn">
205+
<span class="icon">🖥️</span>Display Version
206+
</a>
207+
<a href="pdfs/SwillingSwedesSongbook-eReader.pdf" class="btn">
208+
<span class="icon">📱</span>eReader Version
209+
</a>
210+
</div>
211+
<p class="description" style="margin-top: 20px; font-size: 0.9em;">
212+
<strong>Bound Print:</strong> Two-sided printing with wider inner margins for binding<br>
213+
<strong>Display:</strong> Single-sided with balanced margins, great for screen viewing<br>
214+
<strong>eReader:</strong> Optimized for tablets and e-readers with minimal margins
215+
</p>
216+
</div>
217+
218+
<div class="section">
219+
<h2>ℹ️ About</h2>
220+
<p class="description">
221+
This songbook is a collection of songs from my days in the SCA at the College of St. Golias and since.
222+
It is compiled from many sources and is a work in progress, updated as time allows.
223+
</p>
224+
<p class="description">
225+
<strong>Author:</strong> Sveinn the Swilling Swede<br>
226+
<strong>License:</strong> <a href="https://creativecommons.org/licenses/by-sa/4.0/" style="color: #8B0000;">CC BY-SA 4.0</a><br>
227+
<strong>Source:</strong> <a href="https://github.com/carmiac/SwillingSwedesSongbook" style="color: #8B0000;">GitHub Repository</a>
228+
</p>
229+
</div>
230+
231+
<div class="footer">
232+
<p>🎶 Sing with gusto! 🎶</p>
233+
</div>
234+
</div>
235+
</body>
236+
</html>
237+
EOF
238+
239+
- name: Upload artifact
240+
uses: actions/upload-pages-artifact@v3
241+
with:
242+
path: 'gh-pages'
243+
244+
deploy:
245+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
246+
environment:
247+
name: github-pages
248+
url: ${{ steps.deployment.outputs.page_url }}
249+
runs-on: ubuntu-latest
250+
needs: build
251+
252+
steps:
253+
- name: Deploy to GitHub Pages
254+
id: deployment
255+
uses: actions/deploy-pages@v4

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ This is a collection of songs from my days in the SCA at the College of St. Goli
44

55
It is compiled from many sources into a series of XML files and a songbook template using my OpenLyrics Songbook Maker tool.
66

7-
If you just want the pdf's of the songbook, look in the pdf directory.
7+
## 🌐 View Online
8+
9+
**[Browse the songbook online](https://carmiac.github.io/SwillingSwedesSongbook/)** with our red and gold themed HTML version, or download PDFs for offline use!
810

911
If you want to be able to build it yourself, keep reading. The current version of the build system has been tested in Linux. It may work in MacOS and Windows, but I haven't tested it there.
1012

@@ -35,3 +37,37 @@ If you want to be able to build it yourself, keep reading. The current version o
3537
3. Sing with gusto!
3638

3739
Output files will be in `output/` directory (PDF and HTML versions).
40+
41+
## GitHub Pages Deployment
42+
43+
This repository is configured with GitHub Actions to automatically build and deploy the songbook when changes are pushed to the `main` branch.
44+
45+
### First-Time Setup
46+
47+
To enable GitHub Pages deployment:
48+
49+
1. Go to your repository Settings > Pages
50+
2. Under "Source", select "GitHub Actions"
51+
3. The workflow will automatically deploy on the next push to `main`
52+
53+
The deployed site will be available at: `https://carmiac.github.io/SwillingSwedesSongbook/`
54+
55+
### What Gets Deployed
56+
57+
- **HTML Songbook**: Interactive version with red and gold theme
58+
- **PDF Downloads**: All three PDF versions (Bound Print, Display, eReader)
59+
- **Landing Page**: A downloads page with links to all resources
60+
61+
### Manual Deployment
62+
63+
You can also trigger a manual deployment:
64+
65+
1. Go to Actions tab in your repository
66+
2. Select "Build and Deploy Songbook" workflow
67+
3. Click "Run workflow" button
68+
69+
## Customization
70+
71+
### HTML Theme
72+
73+
The HTML version uses a custom red and gold color scheme defined in `stylesheets/custom-theme.css`. You can modify this file to change colors, fonts, and styling.

sir_patriks_favourites/barretts_privateers.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" ?>
1+
<?xml version='1.0' encoding='utf-8'?>
22
<song xmlns="http://openlyrics.info/namespace/2009/song" version="0.9">
33
<properties>
44
<titles>
@@ -13,7 +13,7 @@
1313
<verse name="v1">
1414
<lines>
1515
Oh, the year was 1778,
16-
(&quot;How I wish I was in Sherbrook now!&quot;)
16+
("How I wish I was in Sherbrook now!")
1717
A letter of mark came from the King
1818
To the scummiest vessel I've ever seen.
1919
</lines>
@@ -30,63 +30,63 @@ The last of Barrett's Privateers.
3030
<verse name="v2">
3131
<lines>
3232
Oh, Elcid Barrett cried the town
33-
(&quot;How I wish I was in Sherbrook now!&quot;)
33+
("How I wish I was in Sherbrook now!")
3434
For twenty brave soul all fisherman who
35-
Would make for him the &quot;Antelope's&quot; crew
35+
Would make for him the "Antelope's" crew
3636
</lines>
3737
</verse>
3838
<verse name="v3">
3939
<lines>
40-
The &quot;Antelopes&quot; sloop was a sickening sight
41-
(&quot;How I wish I was in Sherbrook now!&quot;)
40+
The "Antelopes" sloop was a sickening sight
41+
("How I wish I was in Sherbrook now!")
4242
She had a list to the port and her sails in rags
4343
And the cook in the scuppers with the staggers and jags
4444
</lines>
4545
</verse>
4646
<verse name="v4">
4747
<lines>
4848
On the king's birthday we set to sea
49-
(&quot;How I wish I was in Sherbrook now!&quot;)
49+
("How I wish I was in Sherbrook now!")
5050
It was ninety one days to Montigo Bay
5151
Pumping like madmen all the way
5252
</lines>
5353
</verse>
5454
<verse name="v5">
5555
<lines>
5656
On the ninety sixth day we sailed again
57-
(&quot;How I wish I was in Sherbrook now!&quot;)
57+
("How I wish I was in Sherbrook now!")
5858
When a bloody great Yankee hove in sight
5959
With our cracked four-pounders we made to fight.
6060
</lines>
6161
</verse>
6262
<verse name="v6">
6363
<lines>
6464
Oh, the Yankee lay low down with gold
65-
(&quot;How I wish I was in Sherbrook now!&quot;)
65+
("How I wish I was in Sherbrook now!")
6666
She was broad and fat and loose in stays
6767
But to catch her took the Antelope two whole days.
6868
</lines>
6969
</verse>
7070
<verse name="v7">
7171
<lines>
7272
Then at length we stood two cables away
73-
(&quot;How I wish I was in Sherbrook now!&quot;)
73+
("How I wish I was in Sherbrook now!")
7474
Our cracked four-pounders made an awful din
7575
But with one fat ball the Yank stove us in
7676
</lines>
7777
</verse>
7878
<verse name="v8">
7979
<lines>
8080
Oh, the Antelope shook and pitched on her side
81-
(&quot;How I wish I was in Sherbrook now!&quot;)
81+
("How I wish I was in Sherbrook now!")
8282
Oh Barrett was smashed like a bowl of eggs
8383
And the Maintruck carried off both me legs.
8484
</lines>
8585
</verse>
8686
<verse name="v9">
8787
<lines>
8888
So here I sit in my twenty-third year
89-
(&quot;How I wish I was in Sherbrook now!&quot;)
89+
("How I wish I was in Sherbrook now!")
9090
It's been six years since I sailed away
9191
And I just made Halifax yesterday
9292
</lines>

0 commit comments

Comments
 (0)