Skip to content

Commit 85ec423

Browse files
Merge branch 'dev-github-actions' into src. Close #54.
2 parents 36bd6e0 + 466a308 commit 85ec423

File tree

12 files changed

+91
-57
lines changed

12 files changed

+91
-57
lines changed

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish web
2+
on:
3+
push:
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
12+
- name: Setup Pages
13+
id: pages
14+
uses: actions/configure-pages@v3
15+
16+
- name: Install pandoc
17+
run: |
18+
sudo apt-get install --yes pandoc
19+
20+
- name: Build with Pandoc
21+
run: |
22+
make
23+
24+
- name: Upload artifact
25+
uses: actions/upload-pages-artifact@v2
26+
27+
deploy:
28+
permissions:
29+
contents: read
30+
pages: write
31+
id-token: write
32+
33+
runs-on: ubuntu-latest
34+
35+
needs: build
36+
37+
environment:
38+
name: github-pages
39+
url: ${{steps.deployment.outputs.page_url}}
40+
steps:
41+
- name: Deploy artifact
42+
id: deployment
43+
uses: actions/deploy-pages@v1

Makefile

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
MAP=map
2-
OUT=html
3-
TEMPLATE=tpl/default
1+
.PHONY: all
42

5-
include Makefile.base
3+
all: _site/about.html \
4+
_site/contact.html \
5+
_site/documentation.html \
6+
_site/download.html \
7+
_site/home.html \
8+
_site/index.html
69

7-
publish: all
8-
git add .
9-
git stash
10-
git checkout master
11-
git checkout --theirs stash -- .
12-
git stash drop
13-
git reset .
14-
git clean -df
15-
git clean -df
10+
_site/about.html: about.md
11+
./compile.sh About $< default
1612

17-
home.html: home.nav home.content tpl/home
18-
web-render tpl/home home home.nav home.content > $@
13+
_site/contact.html: contact.md
14+
./compile.sh Contact $< default
1915

20-
index.html: home.html
21-
ln -s $< $@
16+
_site/documentation.html: documentation.md
17+
./compile.sh Documentation $< default
18+
19+
_site/download.html: download.md
20+
./compile.sh Download $< default
21+
22+
_site/home.html: home.md
23+
./compile.sh Home $< home
24+
25+
_site/index.html: _site/home.html
26+
cp $< $@

Makefile.base

Lines changed: 0 additions & 19 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

compile.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
TITLE="$1"
4+
NAV="$(cat nav)"
5+
CONTENT="$(pandoc $2 -t html)"
6+
TARGET="_site/$(basename $2 .md).html"
7+
TEMPLATE="$3"
8+
mkdir -p _site/
9+
env TITLE="$TITLE" NAV="$NAV" CONTENT="$CONTENT" envsubst '${TITLE}':'${NAV}':'${CONTENT}' < tpl/$TEMPLATE > $TARGET

map

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

nav

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<p>
2+
<a href="home.html">Home</a>
3+
<a href="about.html">About</a>
4+
<a href="download.html">Download</a>
5+
<a href="documentation.html">Documentation</a>
6+
<a href="contact.html">Contact</a>
7+
<a href="https://github.com/copilot-language/copilot">Source Code</a>
8+
</p>

0 commit comments

Comments
 (0)