-
Notifications
You must be signed in to change notification settings - Fork 7
177 lines (145 loc) · 5.22 KB
/
sync-build-deploy.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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Merge Dev->Main, Deploy GH-Pages
on:
# Runs on pushes targeting the default branch
#push:
# branches: [$default-branch]
# Runs when cli updates the docs
repository_dispatch:
types: [cli_docs_updated]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Check out main branch of Docs Prod repo
uses: actions/checkout@v3
with:
ref: main
# - name: Merge dev -> main
# uses: devmasx/merge-branch@master
# with:
# type: now
# from_branch: dev
# target_branch: main
# github_token: ${{ github.token }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Add Python Setup Tools
run: python -m pip install --upgrade pip setuptools wheel
# Needed when using more than one repo
# add 'monorepo' to mkdocs.yml file under plugins
- name: Install MKdocs Monorepo Plugin
run: pip install mkdocs-monorepo-plugin
# Adds requirements for social plugin. Needed to automatically fill out meta data.
# add 'social' to mkdocs.yml file under plugins
- run: pip install cffi pillow cairosvg
# Material extension now part of mkdocs
- run: pip install mkdocs-material-extensions
# add mkdocs-redirects
# zoom images
- name: Install mkdocs-redirects
run: pip install mkdocs-redirects
# add lightbox
# zoom images
- name: Install MkDocs Light Box
run: pip install mkdocs-glightbox
# add multirepo to support pulling docs from other repos
- name: Install multirepo
run: pip install mkdocs-multirepo-plugin
# add include support for markdown
- name: Install include-markdown
run: pip install mkdocs-include-markdown-plugin
- name: Install Mkdocs
run: pip install mkdocs
# Install Material insiders theme
- name: Install Material theme
run: pip install mkdocs-material
- name: Setup Pages
id: pages
uses: actions/configure-pages@v2
####################################################
### COPY AND MASSAGE Client Library DOCS REPO README INTO DOCS
####################################################
# enable when there is an client library dev branch
# - name: Extract branch name
# shell: bash
# run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
# id: extract_branch
###### checkout client library files - latest version
- name: Checkout Client Library
uses: actions/checkout@v3
with:
repository: 'quixio/quix-streams'
ref: 'main' # when a dev branch exists we can get the dev content
#ref: '{{ steps.extract_branch.outputs.branch }}'
path: 'quix-streams'
###
####################################################
### END
####################################################
####################################################
### IMPORT LIBRARY README.MD FILES INTO DOCS
####################################################
# clone the library repo
- name: Checkout Samples
uses: actions/checkout@v3
with:
repository: 'quixio/quix-samples'
ref: 'main' # when a dev branch exists we can get the dev content
#ref: '{{ steps.extract_branch.outputs.branch }}'
path: 'samples'
# use our own GitHub Action to bring in library readme files
- name: Quix Samples readme.md importer
uses: quixio/LibraryToMKDocsReadmeMergeAction@v2.17
id: readme_importer
with:
LIBRARY_REPO_PATH: "samples"
DOCS_PATH: ""
REPLACEMENT_PLACEHOLDER: "#ConnectorsGetInsertedHere"
CONNECTORS_TAG: "Connectors"
NAV_INDENT_SPACES: "6"
CONNECTORS_TITLE_REPLACEMENT: "[//]: <> (#connectors_tile_replacement)"
- name: Output Importer Logs
run: |
for i in ${{ steps.readme_importer.outputs.logs }}; do
echo $i
done
####################################################
### END OF IMPORT LIBRARY README.MD's
####################################################
- name: Build MkDocs Site
run: mkdocs build --no-directory-urls
env:
AccessToken: ${{ secrets.QUIX_STREAMS_ACCESS_TOKEN }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./site
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1