File tree Expand file tree Collapse file tree 2 files changed +23
-8
lines changed
Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -73,23 +73,20 @@ jobs:
7373 echo "version=$git_ver" >> $GITHUB_OUTPUT
7474 echo "GIT_VER=$git_ver" >> $GITHUB_ENV
7575
76- - name : Set up SSH
77- run : |
78- mkdir -p ~/.ssh
79- echo "${{ secrets.DOCS_PRIVATEKEY }}" > ~/.ssh/id_rsa
80- chmod 600 ~/.ssh/id_rsa
81- ssh-keyscan -H ${{ vars.DOCS_SERVER }} >> ~/.ssh/known_hosts || true
82-
8376 - name : Deploy documentation
8477 working-directory : docs
78+ shell : bash
8579 env :
8680 GIT_VER : ${{ steps.git_version.outputs.version }}
8781 DOCS_BUILD_DIR : ${{ github.workspace }}/docs/_build
8882 DOCS_DEPLOY_URL_BASE : ${{ vars.DOCS_URL_BASE }}
8983 DOCS_DEPLOY_SERVER : ${{ vars.DOCS_SERVER }}
9084 DOCS_DEPLOY_SERVER_USER : ${{ secrets.DOCS_SERVER_USER }}
9185 DOCS_DEPLOY_PATH : ${{ vars.DOCS_PATH }}
86+ DOCS_DEPLOY_PRIVATEKEY : ${{ secrets.DOCS_PRIVATEKEY }}
9287 # TYPE is optional - only used for output formatting (shows "deploy" or "preview" in logs)
93- # TYPE: ${{ github.ref_name == 'master' && 'deploy' || 'preview' }}
88+ TYPE : ${{ github.ref_name == 'master' && 'deploy' || 'preview' }}
9489 run : |
90+ source $GITHUB_WORKSPACE/docs/utils.sh
91+ add_doc_server_ssh_keys "$DOCS_DEPLOY_PRIVATEKEY" "$DOCS_DEPLOY_SERVER" "$DOCS_DEPLOY_SERVER_USER"
9592 deploy-docs
Original file line number Diff line number Diff line change 1+ # Bash helper functions for adding SSH keys
2+
3+ function add_ssh_keys() {
4+ local key_string=" ${1} "
5+ mkdir -p ~ /.ssh
6+ chmod 700 ~ /.ssh
7+ echo -n " ${key_string} " > ~/.ssh/id_rsa_base64
8+ base64 --decode --ignore-garbage ~ /.ssh/id_rsa_base64 > ~/.ssh/id_rsa
9+ chmod 600 ~ /.ssh/id_rsa
10+ }
11+
12+ function add_doc_server_ssh_keys() {
13+ local key_string=" ${1} "
14+ local server_url=" ${2} "
15+ local server_user=" ${3} "
16+ add_ssh_keys " ${key_string} "
17+ echo -e " Host ${server_url} \n\tStrictHostKeyChecking no\n\tUser ${server_user} \n" >> ~/.ssh/config
18+ }
You can’t perform that action at this time.
0 commit comments