forked from espressif/esp-protocols
Compare commits
1 Commits
tls_cxx-v0
...
docs/docs_
Author | SHA1 | Date | |
---|---|---|---|
a3e8421de8 |
77
.github/workflows/publish-docs.yml
vendored
Normal file
77
.github/workflows/publish-docs.yml
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
name: Docs and Publish New
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
env:
|
||||
DOCS_DEPLOY_URL_BASE: "${{ secrets.DOCS_PREVIEW_SERVER_URL }}"
|
||||
#DOCS_DEPLOY_SERVER: "ci.espressif.cn:42348"
|
||||
DOCS_DEPLOY_SERVER: "ci.espressif.cn:42348"
|
||||
DOCS_DEPLOY_SERVER_USER: "${{ secrets.DOCS_SERVER_USER }}"
|
||||
DOCS_DEPLOY_PRIVATEKEY : "${{ secrets.DOCS_DEPLOY_KEY }}"
|
||||
DOCS_DEPLOY_KEY: "${{ secrets.DOCS_DEPLOY_KEY }}"
|
||||
DOCS_DEPLOY_PATH : "${{ secrets.DOCS_PATH }}"
|
||||
|
||||
jobs:
|
||||
docs_build:
|
||||
name: Docs-Build-And-Upload
|
||||
runs-on: ubuntu-latest
|
||||
# Skip running on forks since it won't have access to secrets
|
||||
#if: github.repository == 'espressif/esp-protocols'
|
||||
steps:
|
||||
- name: Checkout esp-protocols
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
- name: Generate and delploying docs
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install doxygen clang python3-pip
|
||||
python -m pip install breathe recommonmark esp-docs
|
||||
cd $GITHUB_WORKSPACE/components/esp_websocket_client/docs
|
||||
./generate_docs
|
||||
source $GITHUB_WORKSPACE/docs/utils.sh
|
||||
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
|
||||
export GIT_VER=$(git describe --always)
|
||||
ls -l $GITHUB_WORKSPACE/components/esp_websocket_client/docs
|
||||
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/components/esp_websocket_client/docs
|
||||
deploy-docs
|
||||
|
||||
#build_docs:
|
||||
# stage: build
|
||||
# image: $ESP_DOCS_ENV_IMAGE
|
||||
# tags:
|
||||
# - build_docs
|
||||
# artifacts:
|
||||
# when: always
|
||||
# paths:
|
||||
# - docs/_build/*/*/*.txt
|
||||
# - docs/_build/*/*/html/*
|
||||
# expire_in: 4 days
|
||||
# # No cleaning when the artifacts
|
||||
# after_script: []
|
||||
# script:
|
||||
# - cd docs
|
||||
# - pip install -r requirements.txt
|
||||
# - build-docs -l en -t esp32
|
||||
#
|
||||
#.deploy_docs_template:
|
||||
# stage: deploy
|
||||
# image: $ESP_DOCS_ENV_IMAGE
|
||||
# tags:
|
||||
# - deploy_docs
|
||||
# needs:
|
||||
# - build_docs
|
||||
# only:
|
||||
# changes:
|
||||
# - "docs/**/*"
|
||||
# script:
|
||||
# - source ${CI_PROJECT_DIR}/docs/utils.sh
|
||||
# - add_doc_server_ssh_keys ${{ secrets.DOCS_DEPLOY_PRIVATEKEY }} ${{ secrets.DOCS_DEPLOY_SERVER }} ${{ secrets.DOCS_DEPLOY_SERVER_USER }}
|
||||
# - export GIT_VER=$(git describe --always)
|
||||
# - pip install -r ${CI_PROJECT_DIR}/docs/requirements.txt
|
||||
# - deploy-docs
|
||||
#
|
18
docs/utils.sh
Normal file
18
docs/utils.sh
Normal file
@ -0,0 +1,18 @@
|
||||
# Bash helper functions for adding SSH keys
|
||||
|
||||
function add_ssh_keys() {
|
||||
local key_string="${1}"
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
echo -n "${key_string}" >~/.ssh/id_rsa_base64
|
||||
base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 >~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
}
|
||||
|
||||
function add_doc_server_ssh_keys() {
|
||||
local key_string="${1}"
|
||||
local server_url="${2}"
|
||||
local server_user="${3}"
|
||||
add_ssh_keys "${key_string}"
|
||||
echo -e "Host ${server_url}\n\tStrictHostKeyChecking no\n\tUser ${server_user}\n" >>~/.ssh/config
|
||||
}
|
Reference in New Issue
Block a user