Skip to content

Merge branch 'feature/update-widget' into develop #14

Merge branch 'feature/update-widget' into develop

Merge branch 'feature/update-widget' into develop #14

Workflow file for this run

name: Deployment on Dev Server
on:
push:
branches:
- develop
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install pnpm
run: npm install -g pnpm
- run: pnpm install
- name: Install Cypress
run: pnpx cypress install
- name: Build App
run: pnpm run build
- name: Run Cypress tests
run: |
npx concurrently -k -s first -n "APP,TEST" -c "magenta,blue" \
"npx http-server dist --port 5173 --silent" \
"npx wait-on tcp:5173 && pnpm cypress:run"
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.DEV_SSH_PRIVATE_KEY }}
- name: Deploy to Server
env:
DEPLOY_USER: ${{ secrets.DEV_SSH_USER }}
DEPLOY_HOST: ${{ secrets.DEV_SSH_HOST }}
DEPLOY_PATH: ${{ secrets.DEV_SSH_DEPLOY_PATH }}
run: |
echo $DEPLOY_PATH
ssh-keyscan $DEPLOY_HOST >> ~/.ssh/known_hosts
rsync -avz -e "ssh -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o BatchMode=yes" --rsync-path="TERM=xterm rsync" $GITHUB_WORKSPACE/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
ssh -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o BatchMode=yes $DEPLOY_USER@$DEPLOY_HOST "cd $DEPLOY_PATH && docker compose build && docker compose down && docker compose up --build -d"