-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from asam-ev/antora-setup
Antora setup
- Loading branch information
Showing
2 changed files
with
74 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,43 @@ | ||
name: Antora Documentation Build | ||
# Based on https://github.com/OpenSimulationInterface/osi-documentation/blob/master/.github/workflows/antora-build.yml | ||
# 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 ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
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: | ||
trigger_antora: | ||
name: Trigger antora generator | ||
|
||
runs-on: Ubuntu-latest | ||
|
||
env: | ||
MUP_KEY: ${{ secrets.MACHINE_USER_PAT }} | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Trigger generator | ||
if: ${{ env.MUP_KEY != '' }} | ||
uses: peter-evans/repository-dispatch@v3 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Configure Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
token: ${{ secrets.MACHINE_USER_PAT }} | ||
event-type: antora-build-trigger | ||
repository: # Add fork of https://code.asam.net/common/templates/antora-base-repo-example | ||
client-payload: '{"src": "${{ github.repository }}", "ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "head_ref": "${{ github.head_ref }}"}' | ||
|
||
node-version: '20' | ||
- name: Install Antora | ||
run: npm i antora | ||
- name: Generate Site | ||
run: npx antora antora-playbook.yml | ||
- name: Upload Artifacts | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: build/site | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Minimal configuration based on Antora Generator Template | ||
# Source: https://code.asam.net/common/templates/antora-base-repo-example/-/blob/standard_generator/site.yml | ||
# tag::site[] | ||
site: | ||
title: ASAM OpenMATERIAL | ||
url: https://asam-ev.github.io/OpenMATERIAL/ | ||
start_page: asamopenmaterial:specification:index.adoc | ||
# end::site[] | ||
urls: # Creates a redirect for the newest version to the link "latest" | ||
latest_version_segment_strategy: redirect:to | ||
latest_version_segment: latest | ||
|
||
# tag::content[] | ||
content: | ||
sources: | ||
- url: https://github.com/asam-ev/OpenMATERIAL.git | ||
branches: [main, v*.*.*] | ||
tags: [v*,V*] | ||
start_path: .antora | ||
- url: https://code.asam.net/common/asam-terminology.git | ||
start_path: .antora | ||
tags: [v*,V*] | ||
# end::content[] | ||
|
||
ui: | ||
bundle: | ||
url: https://code.asam.net/common/antora-ui/-/jobs/artifacts/main/raw/build/ui-bundle.zip?job=bundle-stable | ||
snapshot: true | ||
# supplemental_files: ./supplemental_ui # Activate this if you need to make local UI changes. Check the official Antora documentation for more information. | ||
|
||
output: | ||
clean: true | ||
dir: ./build/site | ||
|
||
runtime: | ||
fetch: true |