Skip to content

Merge pull request #332 from COS301-SE-2024/dev #10

Merge pull request #332 from COS301-SE-2024/dev

Merge pull request #332 from COS301-SE-2024/dev #10

Workflow file for this run

name: App Deploy
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'query-builder-app/**'
- 'query-builder-backend/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: SSH setup
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
sudo apt-get install sshpass
- name: Deploy
run: |
sshpass -p '${{ secrets.DEPLOY_PASSWORD }}' ssh -p ${{secrets.DEPLOY_PORT}} -v -o StrictHostKeyChecking=no ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} <<'ENDSSH'
cd ~/Query-Builder
git pull
docker compose down
docker system prune -a -f
docker compose up --detach
ENDSSH