rebuild-apiman-antora-docs #197
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |