Skip to content

Commit d6d18bb

Browse files
nightkrsoenkeliebau
andauthoredMar 15, 2022
Build Antora UI bundle from submodule rather than pulling from Nexus (#158)
* Build Antora UI bundle locally rather than pulling from Nexus * Explicitly force Antora to refetch in CI builds Co-authored-by: Sönke Liebau <[email protected]>
1 parent f1691c3 commit d6d18bb

11 files changed

+32714
-2852
lines changed
 

‎.github/workflows/build.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2.4.0
12+
with:
13+
submodules: true
1214
- uses: actions/setup-node@v2
1315
with:
1416
node-version: '16'
1517
cache: 'npm'
16-
- run: npm install
17-
- run: npx antora --fetch local-antora-playbook.yml
18+
- run: npm ci
19+
- run: make ANTORAFLAGS=--fetch

‎.github/workflows/deploy.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2.4.0
16+
with:
17+
submodules: true
1618
- uses: actions/setup-node@v2
1719
with:
1820
node-version: '16'
1921
cache: 'npm'
20-
- run: npm install
21-
- run: npx antora --fetch local-antora-playbook.yml
22+
- run: npm ci
23+
- run: make ANTORAFLAGS=--fetch
2224
- name: Publish to GitHub Pages
2325
uses: peaceiris/actions-gh-pages@v3
2426
with:

‎.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "ui"]
2+
path = ui
3+
url = https://github.com/stackabletech/documentation-ui.git

‎Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
PLAYBOOK := local-antora-playbook.yml
2+
ANTORAFLAGS :=
3+
4+
build:
5+
node_modules/.bin/gulp --cwd ui bundle
6+
node_modules/.bin/antora generate $(PLAYBOOK) $(ANTORAFLAGS)
7+
8+
.PHONY: build

‎README.adoc

+9-4
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ It uses https://antora.org[Antora].
88

99
This repository hosts the Antora playbook file as well as some generic documentation modules.
1010

11-
To build the site install Antora and run:
11+
To build the site, pull submodules, install dependencies and run `make`:
1212

13-
antora antora-playbook.yml
13+
[source,console]
14+
----
15+
$ git submodule update --init
16+
$ npm ci
17+
$ make
18+
----
1419

15-
NOTE: Antora caches all resources it downloads in the user's cache directory (e.g. `~/.cache/antora` directory on Linux). It will _not_ automatically update those. Use the `--fetch` parameter to update all sources.
20+
NOTE: Antora caches all resources it downloads in the user's cache directory (e.g. `~/.cache/antora` directory on Linux). It will _not_ automatically update those. Use the `--fetch` flag (`make ANTORAFLAGS=--fetch`) to update all sources.
1621

1722
== Development
1823

1924
=== Generating the documentation
2025

21-
During development, it can be helpful to use a playbook `local-antora-playbook.yml` which uses content from the local directory instead of the remote git repository.
26+
During development, it can be helpful to use a playbook `local-antora-playbook.yml` which uses content from the local directory instead of the remote git repository. The playbook used by the `Makefile` can be overridden using the `PLAYBOOK` variable (run `make PLAYBOOK=my-local-playbook.yml`).
2227

2328
[source,yaml]
2429
----

‎antora-playbook.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ content:
5252

5353
ui:
5454
bundle:
55-
url: https://repo.stackable.tech/repository/misc/antora-ui-bundle.zip
56-
snapshot: true
55+
url: ./ui/build/ui-bundle.zip
5756
supplemental_files: ./node_modules/@antora/lunr-extension/supplemental_ui
5857

5958
antora:

‎gitpod-antora-playbook.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ content:
5252

5353
ui:
5454
bundle:
55-
url: https://repo.stackable.tech/repository/misc/antora-ui-bundle.zip
56-
snapshot: true
55+
url: ./ui/build/ui-bundle.zip
5756
supplemental_files: ./node_modules/@antora/lunr-extension/supplemental_ui
5857

5958
antora:

‎local-antora-playbook.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ content:
5353

5454
ui:
5555
bundle:
56-
url: https://repo.stackable.tech/repository/misc/antora-ui-bundle.zip
57-
snapshot: true
56+
url: ./ui/build/ui-bundle.zip
5857
supplemental_files: ./node_modules/@antora/lunr-extension/supplemental_ui
5958

6059
antora:

0 commit comments

Comments
 (0)