Skip to content

feat: update ssh command to sync build folder #36

feat: update ssh command to sync build folder

feat: update ssh command to sync build folder #36

Workflow file for this run

name: Deploy CSlant Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Deploy to Remote Host
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST_WEB_2 }}
username: ${{ secrets.REMOTE_USERNAME_WEB_2 }}
password: ${{ secrets.REMOTE_PASS_WEB_2 }}
key: ${{ secrets.SSH_PRIVATE_KEY_WEB_2 }}
port: ${{ secrets.REMOTE_PORT_WEB_2 }}
script: |
source "$HOME/.nvm/nvm.sh"
nvm use ${{ vars.GLOBAL_NVM_USE_VERSION }}
cd ${{ secrets.DOCS_RUNNER_PATH }}
${{ secrets.DOCS_RUNNER_COMMAND }}
- name: Sync build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST_WEB_2 }}
username: ${{ secrets.REMOTE_USERNAME_WEB_2 }}
password: ${{ secrets.REMOTE_PASS_WEB_2 }}
key: ${{ secrets.SSH_PRIVATE_KEY_WEB_2 }}
port: ${{ secrets.REMOTE_PORT_WEB_2 }}
script: |
ssh ${{ vars.NGINX_SERVER_NAME }} "mkdir -p ${{ vars.NGINX_SERVER_DOCS_PATH }}"
rsync -avz --delete ${{ vars.DOCS_PATH_WEB_2 }}/build/ ${{ vars.NGINX_SERVER_NAME }}:${{ vars.NGINX_SERVER_DOCS_PATH }}