Skip to content

Commit 0741fa4

Browse files
committed
Generate from GitHub CI...
Guess I'll bother, hope it works
1 parent 5e8d800 commit 0741fa4

9 files changed

Lines changed: 37 additions & 19336 deletions

File tree

.github/workflows/pages.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: build-and-deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
env:
12+
TZ: Australia/Melbourne
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Generate ICS and Index
17+
run: ./generate.sh
18+
- name: Upload artifact
19+
uses: actions/upload-pages-artifact@v3
20+
with:
21+
path: ./out
22+
23+
deploy:
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
27+
runs-on: ubuntu-latest
28+
needs: build
29+
steps:
30+
- name: Deploy to GitHub Pages
31+
id: deployment
32+
uses: actions/deploy-pages@v5

docs/Adelaide.ics

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

docs/Amsterdam.ics

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

docs/Chicago.ics

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

docs/Melbourne.ics

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

docs/New_York.ics

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

docs/Sydney.ics

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

docs/index.html

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

generate.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
#!/bin/sh
22

3+
mkdir -p out/
4+
35
[ -z "$1" ] && set -- \
4-
Australia/Sydney \
56
Australia/Melbourne \
7+
Australia/Sydney \
68
Australia/Adelaide \
79
America/Chicago \
810
America/New_York \
911
Europe/Amsterdam
1012

1113
set -xe
1214

13-
f="./docs/index.html"
15+
f="./out/index.html"
1416
echo '<h1>daylight_saved</h1>' > $f
1517
echo '<p>Code/README: <a href="https://github.com/nicholastay/daylight_saved">https://github.com/nicholastay/daylight_saved</a></p>' >> $f
1618
echo "<p>Generated at: $(date)</p>" >> $f
1719

1820
echo "<p>.ics files to subscribe to for DST:<ul>" >> $f
1921
for tz in "$@"; do
20-
cargo run $tz 50 150 > "./docs/$(basename "$tz").ics"
22+
cargo run $tz 50 150 > "./out/$(basename "$tz").ics"
2123
echo "<li><a href=\"./$(basename "$tz").ics\">$tz</a></li>" >>$f
2224
done
2325
echo "</ul></p>" >> $f

0 commit comments

Comments
 (0)