-
Notifications
You must be signed in to change notification settings - Fork 15
82 lines (74 loc) · 2.4 KB
/
Copy pathdocs.yml
File metadata and controls
82 lines (74 loc) · 2.4 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: docs
on:
push:
branches:
- main
paths:
- '.github/workflows/docs.yml'
- 'docs/**'
- 'include/**'
- 'tests/**'
- 'examples/**'
- 'CMakeLists.txt'
- 'cmake/**'
- '*.md'
- 'VERSION'
pull_request:
branches:
- main
paths:
- '.github/workflows/docs.yml'
- 'docs/**'
- 'include/**'
- 'tests/**'
- 'examples/**'
- 'CMakeLists.txt'
- 'cmake/**'
- '*.md'
- 'VERSION'
workflow_dispatch:
permissions:
contents: read
jobs:
generate_docs:
runs-on: ${{ github.repository == 'libfn/functional' && 'warp-ubuntu-latest-arm64-2x' || 'ubuntu-latest' }}
container: libfn.azurecr.io/ci-docs:sha-95f599d
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# Guardrail to ensure that we do not update docs after a bad merge
- name: Build and run tests
continue-on-error: false
run: |
mkdir .build
cd .build
cmake -DLIBFN_DOCS=On ..
cmake --build .
ctest
- name: Export docs
continue-on-error: false
run: |
cd .build
cmake --build . --target export_docs
- name: Upload artifact
if: ${{ github.repository == 'libfn/functional' && github.ref_type == 'branch' && github.ref_name == 'main' }}
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: ./.build/docs
# Attempt-scoped (#255); re-run all jobs, not deploy_docs alone, or the name will not match
name: docs-develop-${{ github.run_attempt }}
# Separate job: permissions are per-job, so PR runs must not hold the deploy scopes
deploy_docs:
needs: generate_docs
if: ${{ github.repository == 'libfn/functional' && github.ref_type == 'branch' && github.ref_name == 'main' }}
runs-on: ${{ github.repository == 'libfn/functional' && 'warp-ubuntu-latest-arm64-2x' || 'ubuntu-latest' }}
permissions:
pages: write
id-token: write
steps:
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
with:
artifact_name: docs-develop-${{ github.run_attempt }}