Skip to content

Deploy GitHub Pages

Deploy GitHub Pages #9

Workflow file for this run

name: Deploy GitHub Pages
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-docs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Doxygen
run: sudo apt install -y doxygen
- name: Install Graphviz
run: sudo apt install -y graphviz
- name: Install Doxygen Awesome
working-directory: ${{ github.workspace }}/docs
run: git clone https://github.com/jothepro/doxygen-awesome-css.git -b v2.2.1
- name: Run Doxygen
working-directory: ${{ github.workspace }}/docs
run: doxygen
- name: Archive results
run: tar czf docs-build.tar.gz -C ${{ github.workspace }}/docs html
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docs-build
path: docs-build.tar.gz
build-web-demo:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v11
with:
version: 3.1.60
- name: Configure CMake
run: |
emcmake cmake \
-B ${{ github.workspace }}/build \
-DSL_BUILD_WAI=OFF \
-DSL_BUILD_WITH_OPENSSL=OFF \
-DSL_BUILD_WITH_MEDIAPIPE=OFF \
-DSL_DOWNLOAD_DATA=OFF \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build ${{ github.workspace }}/build --target app-Demo-SLProject -j $(nproc)
- name: Rename `app-Demo-SLProject.html` to `index.html`
working-directory: ${{ github.workspace }}/build
run: mv app-Demo-SLProject.html index.html
- name: Archive results
run: |
tar czf web-demo-build.tar.gz -C ${{ github.workspace }}/build \
index.html \
app-Demo-SLProject.wasm \
app-Demo-SLProject.js \
app-Demo-SLProject.worker.js \
coi-serviceworker.min.js
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: web-demo-build
path: web-demo-build.tar.gz
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs:
- build-docs
- build-web-demo
runs-on: ubuntu-22.04
steps:
- name: Setup GitHub Pages
uses: actions/configure-pages@v5
- name: Download docs build
uses: actions/download-artifact@v4
with:
name: docs-build
- name: Extract docs build
run: mkdir -p dist/docs && tar xf docs-build.tar.gz --strip-components 1 -C dist/docs
- name: Download web demo build
uses: actions/download-artifact@v4
with:
name: web-demo-build
- name: Extract web demo build
run: mkdir -p dist/web-demo && tar xf web-demo-build.tar.gz -C dist/web-demo
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4