Skip to content

feat(WebSocketClient): bind hostname on deploy #11

feat(WebSocketClient): bind hostname on deploy

feat(WebSocketClient): bind hostname on deploy #11

name: Deploy UVL Playground
env:
HOSTNAME: 590c9306-8ced-48f6-85f2-bb8caa1bfd52.ul.bw-cloud-instance.org
USERNAME: ubuntu
WORKDIR: /home/ubuntu
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
on:
push:
branches:
- master
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: Set hostname for WebSocketLanguageServer
run: sed -i 's/languageServerHostName: .*/languageServerHostName: "$HOSTNAME",/' ./WebSocketClient/UVLPlayground/src/config.ts

Check failure on line 32 in .github/workflows/playground_deployment.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/playground_deployment.yml

Invalid workflow file

You have an error in your yaml syntax on line 32
- 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
- name: Copy all necessary files to remote server
run: |
scp -r ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR
scp -r ./WebSocketClient/UVLPlayground/dist $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground
scp -r ./WebSocketClient/UVLPlayground/Dockerfile $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground
scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR
- name: Build and run containers
run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d'