forked from asam-ev/OpenMATERIAL
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (87 loc) · 3.02 KB
/
antora-build.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
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
# Minimal working Antora configuration to publish to GitHub Pages
# Source: https://docs.antora.org/antora/latest/publish-to-github-pages/ (example 2)
# Output URL: https://asam-ev.github.io/OpenMATERIAL
name: Publish with Antora to GitHub Pages
on:
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: github-pages
cancel-in-progress: false
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build OpenMATERIAL documentation and deploy it to gh-pages
runs-on: ubuntu-latest
services:
kroki:
image: yuzutech/kroki:0.15.1
env:
KROKI_MAX_URI_LENGTH: 8000
KROKI_BLOCKDIAG_HOST: blockdiag
KROKI_MERMAID_HOST: mermaid
blockdiag:
image: yuzutech/kroki-blockdiag:0.15.1
mermaid:
image: yuzutech/kroki-mermaid:0.15.1
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout with submodules
uses: actions/checkout@v4
with:
path: repo
fetch-depth: 0 # test if depth in fetch history is required
submodules: recursive
- name: Generate AsciiDoc from JSON
working-directory: repo/scripts
run: |
python3 json2asciidoc.py ../schemas/asset_schema.json
mv asset-schema.adoc ../content/geometry/
python3 json2asciidoc.py ../schemas/mapping_schema.json
mv mapping-schema.adoc ../content/geometry/
python3 json2asciidoc.py ../schemas/material_schema.json
mv material-schema.adoc ../content/material/
python3 json2asciidoc.py ../schemas/material_emp_schema.json
mv material-emp-schema.adoc ../content/material/
python3 json2asciidoc.py ../schemas/material_brdf_schema.json
mv material-brdf-schema.adoc ../content/material/
- name: Configure Pages
uses: actions/configure-pages@v4
- name: Generate site
uses: docker://ghcr.io/asam-ev/project-guide-docker:4
with:
entrypoint: sh
args: repo/run-build.sh # modfied based on OSI
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
with:
path: ./repo/site
deploy:
# Run if it was not triggered from remote OR the remote source was master or main.
if: ${{ github.event_name != 'repository_dispatch' || contains(github.event.client_payload.ref, 'master') || contains(github.event.client_payload.ref, 'main') }}
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
needs: build
permissions:
actions: read
pages: write
id-token: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4