Reduce DEV workers for less ram usage #79
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-dev | |
on: | |
push: | |
branches: | |
- dev | |
paths-ignore: | |
- "*.md" | |
jobs: | |
deploy: | |
name: Deploy dev | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install SSH key | |
uses: kielabokkie/ssh-key-and-known-hosts-action@v1 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
ssh-host: ${{ secrets.SSH_HOST_NEW_IP }} | |
ssh-port: ${{ secrets.SSH_HOST_NEW_PORT }} | |
- name: Build and deploy | |
run: | | |
ssh -p ${{ secrets.SSH_HOST_NEW_PORT }} -l ${{ secrets.SSH_USER_NEW }} ${{ secrets.SSH_HOST_NEW_IP }} << EOF | |
set -e | |
echo "Navigating to the project directory" | |
cd /home/${{ secrets.SSH_USER_NEW }}/dev/ | |
echo "Fetching latest changes from the repository" | |
git fetch origin dev | |
echo "Switching branches" | |
git checkout dev | |
echo "Resetting to the latest commit" | |
git reset --hard origin/dev | |
echo "Building and starting containers" | |
LISTEN=49223 WORKERS=4 docker compose up -d --build | |
EOF |