Skip to content

Commit

Permalink
Added CI/CD procedures and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
RJMurg committed May 11, 2024
1 parent bbf3793 commit 724d36a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy-to-vps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy main to Huey-Dewey-Louie

on:
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Build and Deploy with Docker Compose
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.HOST }} << 'EOF'
cd /src/eveningbot
git reset --hard HEAD
git pull origin main
docker compose up -d --build
docker image prune -f
EOF
5 changes: 5 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: '3.8'
services:
eveningbot:
build: .
restart: on-failure:3

0 comments on commit 724d36a

Please sign in to comment.