forked from openstack-k8s-operators/data-plane-adoption
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 1.97 KB
/
docs.yaml
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
name: Build Docs
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- .github/workflows/docs*
- docs_dev/**
- docs_user/**
- Gemfile
- Makefile
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: ruby/[email protected]
with:
ruby-version: '3.2'
- name: Install Asciidoc
run: make docs-dependencies
- name: Build user docs
run: make docs-user
- name: Build dev docs
run: make docs-dev
- name: Prepare gh-pages branch
run: |
git config user.name github-actions
git config user.email [email protected]
git branch -D gh-pages &>/dev/null || true
git checkout -b gh-pages aabb4803f89a3b006094d8ae7a933650f644d036
- name: Create index.html
run: |
cat > index.html <<EOF
<html>
<body>
<h1>Data Plane Adoption documentation</h1>
<ul>
<li><a href="user/">User documentation</a></li>
<li><a href="dev/">Contributor documentation</a></li>
</ul>
</body>
<html>
EOF
- name: Commit asciidoc docs
run: |
mv -T docs_build/adoption-user user
mv -T docs_build/adoption-dev dev
mv user/index-upstream.html user/index.html
mv dev/index-upstream.html dev/index.html
git add user
git add dev
git add index.html
git commit -m "Rendered docs"
- name: Push rendered docs to gh-pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git push --force origin gh-pages