Merge Dev->Main, Deploy GH-Pages #138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |