fix(WebSocketClient): change port number to fit local setup and chang… #19
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: Deploy playground website | |
env: | |
HOSTNAME: 590c9306-8ced-48f6-85f2-bb8caa1bfd52.ul.bw-cloud-instance.org | |
USERNAME: ubuntu | |
WORKDIR: /home/ubuntu/WebSocketClient | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "WebSocketClient/**" | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
cache-dependency-path: WebSocketClient/UVLPlayground/package-lock.json | |
- name: Install dependencies | |
working-directory: WebSocketClient/UVLPlayground | |
run: npm install | |
- name: Build | |
working-directory: WebSocketClient/UVLPlayground | |
run: npm run build | |
- name: Install SSH key | |
run: | | |
mkdir -p ~/.ssh | |
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -H $HOSTNAME >> ~/.ssh/known_hosts | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Copy directory to remote server | |
run: | | |
scp -r ./WebSocketClient/UVLPlayground/dist/ $USERNAME@$HOSTNAME:$WORKDIR | |
- name: Copy Dockerfile to remote server | |
run: scp -r ./WebSocketClient/UVLPlayground/Dockerfile $USERNAME@$HOSTNAME:$WORKDIR | |
- name: Copy deployment script to remote server | |
run: | | |
scp -r ./WebSocketClient/deployment.sh $USERNAME@$HOSTNAME:$WORKDIR | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Run remote script | |
run: | | |
ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'cd WebSocketClient && chmod +x ./deployment.sh && ./deployment.sh' | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} |