-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (51 loc) · 2.19 KB
/
pages.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
# Workflow that always runs
name: GitHub Pages
# This action should run on every commit
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build-docs"
build-docs:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# warning! This is a shallow clone, and has no git history for docs!
- uses: actions/checkout@v4
- name: Set apt mirror
# GitHub Actions apt proxy is super unstable
# see https://github.com/actions/runner-images/issues/7048
run: |
# make sure there is a `\t` between URL and `priority:*` attributes
printf 'http://azure.archive.ubuntu.com/ubuntu priority:1\n' | sudo tee /etc/apt/mirrors.txt
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install doxygen graphviz texinfo -y
- name: Configure
run: cmake . -B build/docs/ -DBUILD_ONLY_DOCS=true
- name: Build Docs
run: cmake --build build/docs/ --target=doxydocs
- name: Upload docs
uses: actions/upload-pages-artifact@v2
with:
path: ./build/docs/html
deploy-docs:
name: publish docs (main-branch only)
if: github.ref == 'refs/heads/main'
needs: build-docs
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4