Skip to content

fix cicd

fix cicd #16

Workflow file for this run

name: Docker Image CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: |
docker-compose -f docker-compose.prod.yml build
- name: Save the Docker image to tar file
run: |
docker save -o telegram_gpt_bot_image.tar telegram_gpt_bot_image:latest
- name: Copy file via scp
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
overwrite: true
source: "docker-compose.prod.yml,telegram_gpt_bot_image.tar"
target: "/opt/TelegramGPTBot"
- name: Executing remote ssh commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
script: |
docker load --input /opt/TelegramGPTBot/telegram_gpt_bot_image.tar
OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} BOT_TOKEN=${{ secrets.BOT_TOKEN }} \
ADMIN_CHAT_ID=${{ secrets.ADMIN_CHAT_ID }} LOG_LEVEL=${{ secrets.LOG_LEVEL }} \
docker compose -f /opt/TelegramGPTBot/docker-compose.prod.yml up