Skip to content

Commit

Permalink
fix: CD
Browse files Browse the repository at this point in the history
  • Loading branch information
almax07082005 committed Jul 29, 2024
1 parent 1c058f0 commit 670234e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,32 @@ jobs:
run: ./gradlew bootJar

- name: Build Docker image
run: docker build --platform linux/amd64 -t almaxgood/cardio-bot:1.0.0 .
run: docker build --platform linux/amd64 -t almaxgood/cardio-bot:${{ vars.DOCKER_TAG }} .

- name: Push Docker image
run: docker push almaxgood/cardio-bot:1.0.0
run: docker push almaxgood/cardio-bot:${{ vars.DOCKER_TAG }}

- name: Install sshpass
run: sudo apt install sshpass

- name: Compose .env file
run: |
echo POSTGRES_USER=${{ secrets.POSTGRES_USER }}>>.env
echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}>>.env
echo MAIN_TOKEN=${{ secrets.MAIN_TOKEN }}>>.env
echo LOGGER_TOKEN=${{ secrets.LOGGER_TOKEN }}>>.env
echo GUIDE=${{ secrets.GUIDE }}>>.env
echo DOCKER_TAG=${{ vars.DOCKER_TAG }}>>.env
- name: Copy .env file to VM
uses: appleboy/[email protected]
with:
host: ${{ secrets.VM_IP }}
username: root
password: ${{ secrets.VM_PASSWORD }}
source: ./.env
target: ~/cardio-bot

- name: Run on VM
run: sshpass -p ${{ secrets.VM_PASSWORD }} ssh -o StrictHostKeyChecking=no root@${{ secrets.VM_IP }}
'cd ~/cardio-bot &&
Expand Down

0 comments on commit 670234e

Please sign in to comment.