-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (50 loc) · 1.75 KB
/
rebuild-and-deploy-antora-docs.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
name: rebuild and deploy Antora documentation website
on:
push:
branches: [ main ]
paths-ignore:
- '.github/workflows/**'
workflow_dispatch:
repository_dispatch:
types:
- rebuild-apiman-antora-docs
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 14.x
- name: Install Antora and NPM deps
run: npm ci
- name: Generate Antora website
run: rm -rf docs && npx antora generate --fetch --stacktrace antora-playbook.yml
env:
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}
- name: Reindex Apiman docs with Algolia
run: >-
docker run
-e UPDATE_NB_HITS=${{ env.UPDATE_NB_HITS }}
-e APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }}
-e API_KEY=${{ secrets.ALGOLIA_ADMIN_API_KEY }}
-e CONFIG=/docsearch/algolia-config.json
-v $PWD:/docsearch:Z
--rm -t
algolia/docsearch-scraper:v1.16.0
env:
UPDATE_NB_HITS: "true"
- name: Commit Antora build to repository
uses: EndBug/[email protected]
with:
author_name: apiman-ci
default_author: user_info
message: 'chore: regenerate documentation with Antora'
add: ./docs --force
push: false
# We will push the commit to /antora branch and NOT store on main (keeps it cleaner).
- name: Push to `serve` branch
run: git push origin HEAD:antora -f