Connector - Build Doc #26
Workflow file for this run
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: Connector - Build Doc | |
on: | |
push: | |
# Pattern matched against v<MAJOR>.<MINOR>.<PATCH>-doc | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+-doc' | |
branches: | |
- 'master' | |
- 'release/connector/*' | |
- 'support/connector/*' | |
pull_request: | |
branches: | |
- 'master' | |
- 'release/connector/*' | |
- 'support/connector/*' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Build doc | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.7' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Install jsdoc | |
run: npm install -g jsdoc | |
- name: Install Python Dependencies | |
run: pip install -r docs/requirements.txt | |
- name: Build HTML | |
run: make html -C docs | |
- name: Archive HTML documentation | |
uses: actions/upload-artifact@v3 | |
with: | |
name: HTML doc | |
path: docs/_build/html | |
- name: Getting version from tag | |
id: vars | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: echo "version=$(echo $GITHUB_REF | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT | |
- name: Install AWS CLI | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y awscli | |
- name: Publish HTML documentation | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
aws s3 sync --acl public-read docs/_build/html/ s3://${{ secrets.AWS_DOC_BUCKET }}/documentation/connector/${{ steps.vars.outputs.version }}/api/javascript/ | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |