Skip to content

Merge pull request #3 from Muimi-Chat/staging #6

Merge pull request #3 from Muimi-Chat/staging

Merge pull request #3 from Muimi-Chat/staging #6

Workflow file for this run

name: Deploy to School VM
on:
push:
branches:
- main
pull_request:
types: [closed]
branches:
- main
jobs:
deploy:
if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.VM_SSH_KEY }}
- name: Deploy via SSH
env:
VM_IP: ${{ secrets.VM_IP }}
VM_USER: ${{ secrets.VM_USER }}
run: |
ssh -o StrictHostKeyChecking=no $VM_USER@$VM_IP '
cd GITLOCAL/chat-service/ && \
git pull && \
docker compose down && \
docker compose -f docker-compose-prod.yml up -d
'