Skip to content

Merge pull request #10 from xmnlz/production #98

Merge pull request #10 from xmnlz/production

Merge pull request #10 from xmnlz/production #98

name: 🚀 Deploy bot on hosting
on:
push:
branches: [staging]
jobs:
update-src-folder:
name: 🪀 Update src folder with new files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: src
- name: Setup SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: unnecessary
- name: Adding Known Hosts
run: ssh-keyscan -p ${{ secrets.SSH_PORT }} -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Deploy with rsync
run: rsync -rvzP --delete -e "ssh -p ${{ secrets.SSH_PORT }}" src ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:home/xmnlz/vpitashka/
- name: Run docker compose
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd home/xmnlz/vpitashka/
docker compose --env-file .env.production up -d --no-deps --build vpitashka