-
Notifications
You must be signed in to change notification settings - Fork 85
138 lines (121 loc) · 3.97 KB
/
Copy pathdocs.yaml
File metadata and controls
138 lines (121 loc) · 3.97 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Build Docs
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- .github/workflows/docs*
- docs_dev/**
- docs_user/**
- Gemfile
- Makefile
permissions:
contents: read
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.9'
- uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1
with:
ruby-version: '3.2'
- name: Install Asciidoc
run: make docs-dependencies
- name: Build upstream user docs
run: make docs-user
- name: Build downstream preview of user docs
run: BUILD=downstream make docs-user
- name: Build dev docs
run: make docs-dev
- name: Test user docs
run: |
INSTALL_YAMLS_REF=$(grep -o install_yamls docs_build/adoption-user/index-downstream.html | wc -l)
if [[ $INSTALL_YAMLS_REF -gt 0 ]]; then
echo user facing docs should NOT mention install_yamls
grep install_yamls docs_build/adoption-user/index-downstream.html
exit 1
fi
- name: Prepare site
run: |
mkdir -p _site
mv -T docs_build/adoption-user _site/user
mv -T docs_build/adoption-dev _site/dev
mv _site/user/index-upstream.html _site/user/index.html
mv _site/user/index-downstream.html _site/user/downstream.html
mv _site/dev/index-upstream.html _site/dev/index.html
cat > _site/index.html <<EOF
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
.asciidoc {
height:90vh;
background:#fff;
color:#fff;
}
.topnav {
overflow: hidden;
background-color: #333;
}
.topnav a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 2vh 2vh;
text-decoration: none;
font-size: 2vh;
}
.topnav a:hover {
background-color: #ddd;
color: black;
}
.topnav a.active {
background-color: #7a2518;
color: white;
}
</style>
</head>
<body>
<div class="topnav">
<a class="active" href="user/" target="content">User</a>
<a href="dev/" target="content">Contributor</a>
</div>
<div class="asciidoc">
<iframe name="content" width="100%" height="100%" src="user/index.html"></iframe>
</div>
</body>
</html>
EOF
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: _site
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5