Skip to content

Commit

Permalink
Merge branch 'dev-github-actions' into src. Close #54.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanperez-keera committed Dec 10, 2023
2 parents 36bd6e0 + 466a308 commit 85ec423
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 57 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish web
on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name: Install pandoc
run: |
sudo apt-get install --yes pandoc
- name: Build with Pandoc
run: |
make
- name: Upload artifact
uses: actions/upload-pages-artifact@v2

deploy:
permissions:
contents: read
pages: write
id-token: write

runs-on: ubuntu-latest

needs: build

environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Deploy artifact
id: deployment
uses: actions/deploy-pages@v1
39 changes: 22 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
MAP=map
OUT=html
TEMPLATE=tpl/default
.PHONY: all

include Makefile.base
all: _site/about.html \
_site/contact.html \
_site/documentation.html \
_site/download.html \
_site/home.html \
_site/index.html

publish: all
git add .
git stash
git checkout master
git checkout --theirs stash -- .
git stash drop
git reset .
git clean -df
git clean -df
_site/about.html: about.md
./compile.sh About $< default

home.html: home.nav home.content tpl/home
web-render tpl/home home home.nav home.content > $@
_site/contact.html: contact.md
./compile.sh Contact $< default

index.html: home.html
ln -s $< $@
_site/documentation.html: documentation.md
./compile.sh Documentation $< default

_site/download.html: download.md
./compile.sh Download $< default

_site/home.html: home.md
./compile.sh Home $< home

_site/index.html: _site/home.html
cp $< $@
19 changes: 0 additions & 19 deletions Makefile.base

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

TITLE="$1"
NAV="$(cat nav)"
CONTENT="$(pandoc $2 -t html)"
TARGET="_site/$(basename $2 .md).html"
TEMPLATE="$3"
mkdir -p _site/
env TITLE="$TITLE" NAV="$NAV" CONTENT="$CONTENT" envsubst '${TITLE}':'${NAV}':'${CONTENT}' < tpl/$TEMPLATE > $TARGET
6 changes: 0 additions & 6 deletions map

This file was deleted.

8 changes: 8 additions & 0 deletions nav
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<p>
<a href="home.html">Home</a>
<a href="about.html">About</a>
<a href="download.html">Download</a>
<a href="documentation.html">Documentation</a>
<a href="contact.html">Contact</a>
<a href="https://github.com/copilot-language/copilot">Source Code</a>
</p>
4 changes: 0 additions & 4 deletions tpl/default
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh

cat <<!
<!DOCTYPE html>
<html>
<head>
Expand All @@ -21,4 +18,3 @@ cat <<!
</div>
</body>
</html>
!
20 changes: 9 additions & 11 deletions tpl/home
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh

cat <<!
<!DOCTYPE html>
<html>
<head>
Expand All @@ -15,7 +12,9 @@ cat <<!
<a href="index.html">Copilot</a>
<span>Realtime Programming Language and Runtime Verification Framework</span>
</div>
<div id="menu">$NAV</div>
<div id="menu">
$NAV
</div>
<div id="panel">
<div class="left">
<p>
Expand Down Expand Up @@ -46,12 +45,11 @@ ctemp = (unsafeCast temp) * (<mark class="literal">150.0</mark> / <mark class="l
spec = do
trigger <mark class="string">"heaton"</mark> (ctemp < <mark class="literal">18.0</mark>) [arg ctemp]
trigger <mark class="string">"heatoff"</mark> (ctemp > <mark class="literal">21.0</mark>) [arg ctemp]</code></pre>
</div>
</div>
<div id="content">
$CONTENT
</div>
</div>
</body>
</div>
<div id="content">
$CONTENT
</div>
</div>
</body>
</html>
!

0 comments on commit 85ec423

Please sign in to comment.