Skip to content

Updated JS / UI infrastructure #90

Updated JS / UI infrastructure

Updated JS / UI infrastructure #90

Workflow file for this run

# Copyright 2021-2024 The Khronos Group, Inc.
# SPDX-License-Identifier: Apache-2.0
# Github CI file for Vulkan Antora Guide
name: CI
# Controls when the action will run.
on:
push:
workflow_dispatch:
inputs:
Antora_UI_Hash:
description: 'Antora UI hash (branch name or tag) to use passed from the caller workflow'
default: 'main'
required: false
type: string
GLSL_Commit_Hash:
description: 'GLSL Commit hash (branch name or tag) to use passed from the caller workflow'
default: 'main'
required: false
type: string
Guide_Commit_Hash:
description: 'Guide Commit hash (branch name or tag) to use passed from the caller workflow'
default: 'main'
required: false
type: string
DOC_Commit_Hash:
description: 'Docs Commit hash (branch name or tag) to use passed from the caller workflow'
default: 'main'
required: false
type: string
Samples_Commit_Hash:
description: 'Samples Commit hash (branch name or tag) to use passed from the caller workflow'
default: 'main'
required: false
type: string
Tutorial_Commit_Hash:
description: 'Tutorial Commit hash (branch name or tag) to use passed from the caller workflow'
default: 'main'
required: false
type: string
Publish_Local:
description: 'Should publish to the local github pages https://${GITHUB_REPOSITORY}.github.io'
default: true
required: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can
# access it
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: "checkout Antora UI"
uses: actions/checkout@v4
with:
repository: KhronosGroup/antora-ui-khronos
path: ./antora-ui-khronos
ref: ${{ inputs.Antora_UI_Hash > '' && inputs.Antora_UI_Hash || 'main' }}
- name: "checkout GLSL"
uses: actions/checkout@v4
with:
repository: KhronosGroup/GLSL
path: ./GLSL
ref: ${{ inputs.GLSL_Commit_Hash > '' && inputs.GLSL_Commit_Hash || 'main' }}
submodules: recursive
- name: "checkout Vulkan Guide"
uses: actions/checkout@v4
with:
repository: KhronosGroup/Vulkan-Guide
path: ./Vulkan-Guide
ref: ${{ inputs.Guide_Commit_Hash > '' && inputs.Guide_Commit_Hash || 'main' }}
submodules: recursive
- name: "Checkout Vulkan Docs"
uses: actions/checkout@v4
with:
repository: KhronosGroup/Vulkan-Docs
path: ./Vulkan-Docs
ref: ${{ inputs.DOC_Commit_Hash > '' && inputs.DOC_Commit_Hash || 'main' }}
submodules: recursive
- name: "Checkout Vulkan Samples"
uses: actions/checkout@v4
with:
repository: KhronosGroup/Vulkan-Samples
path: ./Vulkan-Samples
ref: ${{ inputs.Samples_Commit_Hash > '' && inputs.Samples_Commit_Hash || 'main' }}
submodules: recursive
- name: "Checkout Vulkan Tutorial"
uses: actions/checkout@v4
with:
repository: KhronosGroup/Vulkan-Tutorial
path: ./Vulkan-Tutorial
ref: ${{ inputs.Tutorial_Commit_Hash > '' && inputs.Tutorial_Commit_Hash || 'main' }}
submodules: recursive
- name: "setup npm"
uses: actions/setup-node@v4
with:
node-version: '20.12.2'
cache: 'npm'
cache-dependency-path: docs-site/package-lock.json
- name: "force clear the npm cache"
run: npm cache clean --force
- name: "run npm install for ui bundle"
working-directory: antora-ui-khronos
run: npm install
- name: "run npm install for docs-site"
working-directory: docs-site
run: npm install
- name: "run npm install for Vulkan-Docs"
working-directory: Vulkan-Docs
run: npm install
- name: "ensure we have all dependencies for building/searching/highlighting"
run: |
sudo gem install rouge
sudo apt-get update
sudo apt install xorg-dev libglu1-mesa-dev
sudo apt-get install -y asciidoctor
pip install lxml
- name: "build the ui bundle"
working-directory: antora-ui-khronos
run: |
npx update-browserslist-db@latest
./node_modules/gulp/bin/gulp.js --version
./node_modules/gulp/bin/gulp.js bundle
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: ui-bundle.zip
path: antora-ui-khronos/build/ui-bundle.zip
retention-days: 5
- name: "copy ui-bundle.zip to vulkan-site"
run: cp antora-ui-khronos/build/ui-bundle.zip docs-site/
- name: "prepare tutorials"
working-directory: Vulkan-Tutorial/antora
run: |
make setup_tutorial
- name: "prepare repos with make"
run: make prep-sources
- name: "prepare samples"
working-directory: Vulkan-Samples
run: cmake -H"." -B"build/unix" -DVKB_GENERATE_ANTORA_SITE=ON
- name: "build (npx) with stacktrace"
working-directory: docs-site
run: |
npx antora antora-playbook.yml --stacktrace
touch build/site/.nojekyll
- name: 'Upload site artifact'
uses: actions/upload-artifact@v4
with:
name: fullSite
path: docs-site/build
retention-days: 5
- name: Publish to GitHub Pages
if: "${{ github.event.inputs.Publish_Local || github.event_name == 'pull_request'}}"
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs-site/build/site