-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (35 loc) · 1.51 KB
/
github-pages.yml
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
name: github-pages
# inspired by https://blog.oldweb2.com/remix-static-site
on:
push:
branches: [main, tabler]
#schedule:
# - cron: "42 * * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20.x"
- run: go install golang.org/x/tools/cmd/present
- run: go install ./cmd/reveal
- name: convert .reveal.md files
run: reveal presentations/*/*.reveal.md
- name: start server and mirror it with wget
run: |
go run golang.org/x/tools/cmd/present -http=127.0.0.1:3999 -play=false -orighost=gnolang.github.io &
sleep 5
wget --mirror http://localhost:3999 -P workshops --no-host-directories --page-requisites --adjust-extension --convert-links
# hacks: wget is missing styles.css (injected in JS)
wget --mirror http://localhost:3999/static/styles.css -P workshops --no-host-directories --page-requisites --adjust-extension --convert-links
# hacks: copy over the images
# (at time of writing, they come from rendered markdown files, which wget can't follow)
for i in presentations/*/*.{png,jpg,jpeg}; do cp $i workshops/$i; done || true
sed -i='' s@/static/@/workshops/static/@ workshops/static/slides.js
- run: find workshops/ -type f -ls
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./workshops