-
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (104 loc) · 4.47 KB
/
wiki.yml
File metadata and controls
121 lines (104 loc) · 4.47 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Publish Wiki & Deploy Site
on:
push:
branches:
- main
paths:
- 'book/**'
- 'website/**'
- '.env.markflow'
- '.github/workflows/wiki.yml'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
publish-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare wiki content
run: |
mkdir -p wiki
# Copy book files to wiki directory
cp book/README.md wiki/Home.md
cp book/01-introduction.md wiki/01-Introduction.md
cp book/02-getting-started.md wiki/02-Getting-Started.md
cp book/03-using-the-cli.md wiki/03-Using-the-CLI.md
cp book/04-grammar-syntax.md wiki/04-Grammar-Syntax.md
cp book/05-semantic-actions.md wiki/05-Semantic-Actions.md
cp book/06-typed-ast.md wiki/06-The-TypedAST.md
cp book/07-typed-ast-builder.md wiki/07-TypedAST-Builder.md
cp book/08-zig-example.md wiki/08-Zig-Example.md
cp book/09-reference.md wiki/09-Reference.md
cp book/10-packaging-distribution.md wiki/10-Packaging-Distribution.md
cp book/11-hir-builder.md wiki/11-HIR-Builder.md
cp book/12-embedding-sdk.md wiki/12-Embedding-SDK.md
cp book/13-async-runtime.md wiki/13-Async-Runtime.md
cp book/14-runtime-plugins.md wiki/14-Runtime-Plugins.md
cp book/15-building-dsls.md wiki/15-Building-DSLs.md
cp book/16-image-pipeline-dsl.md wiki/16-Image-Pipeline-DSL.md
# Fix internal links for wiki format
sed -i 's|\./01-introduction\.md|01-Introduction|g' wiki/*.md
sed -i 's|\./02-getting-started\.md|02-Getting-Started|g' wiki/*.md
sed -i 's|\./03-using-the-cli\.md|03-Using-the-CLI|g' wiki/*.md
sed -i 's|\./04-grammar-syntax\.md|04-Grammar-Syntax|g' wiki/*.md
sed -i 's|\./05-semantic-actions\.md|05-Semantic-Actions|g' wiki/*.md
sed -i 's|\./06-typed-ast\.md|06-The-TypedAST|g' wiki/*.md
sed -i 's|\./07-typed-ast-builder\.md|07-TypedAST-Builder|g' wiki/*.md
sed -i 's|\./08-zig-example\.md|08-Zig-Example|g' wiki/*.md
sed -i 's|\./09-reference\.md|09-Reference|g' wiki/*.md
sed -i 's|\./10-packaging-distribution\.md|10-Packaging-Distribution|g' wiki/*.md
sed -i 's|\./11-hir-builder\.md|11-HIR-Builder|g' wiki/*.md
sed -i 's|\./12-embedding-sdk\.md|12-Embedding-SDK|g' wiki/*.md
sed -i 's|\./13-async-runtime\.md|13-Async-Runtime|g' wiki/*.md
sed -i 's|\./14-runtime-plugins\.md|14-Runtime-Plugins|g' wiki/*.md
sed -i 's|\./15-building-dsls\.md|15-Building-DSLs|g' wiki/*.md
sed -i 's|\./16-image-pipeline-dsl\.md|16-Image-Pipeline-DSL|g' wiki/*.md
- name: Upload wiki
uses: Andrew-Chen-Wang/github-wiki-action@v4
with:
path: wiki/
token: ${{ secrets.GITHUB_TOKEN }}
deploy-site:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Markflow
run: curl -sL https://raw.githubusercontent.com/darmie/markflow/main/install.sh | bash
- name: Build site
run: |
export PATH="$HOME/.markflow:$PATH"
mkdir -p site
# Copy website landing page and assets to site root
cp website/index.html site/index.html
cp website/og-image.png site/og-image.png
cp website/favicon.ico site/favicon.ico
cp website/favicon.svg site/favicon.svg
cp website/apple-touch-icon.png site/apple-touch-icon.png
cp website/icon-192x192.png site/icon-192x192.png
cp website/site.webmanifest site/site.webmanifest
touch site/.nojekyll
echo "zyntax.org" > site/CNAME
# Build book docs with Markflow into /book subdirectory
markflow build --prebake --source ./book --output ./site/book --config .env.markflow
# Verify book output exists
ls -la site/book/
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4