Skip to content

Commit

Permalink
Build and release to ec2 (#1)
Browse files Browse the repository at this point in the history
* Remove dotenv from python script

* Add deploy to E2 workflow
  • Loading branch information
DrR0X-glitch authored Jan 17, 2025
1 parent 9593209 commit bc9d6db
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy to GCP E2

on:
push:
branches: [ main ]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Deploy to E2 Instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.GCP_INSTANCE_IP }}
username: ${{ secrets.GCP_USERNAME }}
key: ${{ secrets.GCP_SSH_KEY }}
script: |
# Create app directory if it doesn't exist
cd ~/hass.agent-bot
# Or if directory already exists:
git pull origin main
# Build and start containers
sudo docker-compose build
sudo docker-compose up -d
2 changes: 0 additions & 2 deletions discord_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import nextcord
from nextcord import Interaction
from nextcord.ext import commands
from dotenv import load_dotenv

load_dotenv("../.env")

bot = commands.Bot(command_prefix="!", intents=nextcord.Intents.all())

Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
nextcord
python-dotenv
nextcord

0 comments on commit bc9d6db

Please sign in to comment.