Skip to content

Commit

Permalink
KL-184/deploy: use compose.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhamma committed Oct 8, 2024
1 parent 5da1d11 commit 518ebf1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Build with Gradle
run: ./gradlew clean build -x test

- name: Dockerhub login
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
Expand All @@ -46,6 +46,15 @@ jobs:
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }}:latest

- name: Copy compose.yaml to EC2
uses: appleboy/scp-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_KEY }}
source: "compose.yaml"
target: "~/"

- name: Deploy to EC2
uses: appleboy/ssh-action@master
with:
Expand All @@ -54,5 +63,5 @@ jobs:
key: ${{ secrets.EC2_KEY }}
script: |
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }}:latest
sudo docker-compose -p eonedu up -d
sudo docker compose -f ~/compose.yaml -p eonedu up -d
sudo docker image prune -a -f

0 comments on commit 518ebf1

Please sign in to comment.