Skip to content

Commit

Permalink
add copy to server in cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
alserious committed Oct 12, 2023
1 parent 0a7e614 commit be11e0b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
image_name: TelegramGPTBot:$(date +%s)
image_path: /home/runner/work/TelegramGPTBot/TelegramGPTBot/TelegramGPTBot_image.tar
image_path: /home/runner/work/TelegramGPTBot/TelegramGPTBot/telegram_gpt_bot_image.tar
prod_image_folder_path: /root/projects/TelegramGPTBot

jobs:
Expand All @@ -17,9 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: ls -l
- name: Check ls -l before build
run: |
ls -l
ls -l -h
- name: Build the Docker image
run: |
Expand All @@ -29,21 +29,25 @@ jobs:
run: |
docker save -o telegram_gpt_bot_image.tar telegram_gpt_bot_image:latest
- name: ls -l
- name: Check ls -l after docker build
run: |
ls -l
ls -l -h
- name: Copy tar file to prod server
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
# source: "tests/a.txt,tests/b.txt"
source: "$image_path"
target: $prod_image_folder_path

- name: Load the Docker image from tar file
run: |
docker load --input telegram_gpt_bot_image.tar
# - name: Copy tar file to prod server
# run: |
# # docker save -o $image_path $image_name
Expand Down

0 comments on commit be11e0b

Please sign in to comment.