Skip to content

Commit

Permalink
Merge pull request #40 from Sopo2023/feat/#1
Browse files Browse the repository at this point in the history
chore: git actions workflows
  • Loading branch information
GayeongKimm authored Jul 30, 2024
2 parents 8a32543 + b724599 commit 46c737b
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,16 @@ jobs:
- name: Build with Gradle
run: ./gradlew build -x test

- name: Deploy with SSH
if: github.ref == 'refs/heads/main'
uses: appleboy/ssh-action@master

- name: List build/libs contents
run: ls -la build/libs

- name: Docker build
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t ${{ secrets.DOCKER_USERNAME }}/sopo .
docker push ${{ secrets.DOCKER_USERNAME }}/sopo:latest
- name: Deploy with SSH
if: github.ref == 'refs/heads/main'
- name: Deploy to prod
uses: appleboy/ssh-action@master
id: deploy-prod
with:
host: ${{ secrets.HOST_PROD }}
host: ${{ secrets.HOST_PROD }}
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
key: ${{ secrets.PRIVATE_KEY }}
port: ${{ secrets.PORT }}
envs: GITHUB_SHA
script: |
Expand All @@ -70,4 +59,4 @@ jobs:
docker rmi ${{ secrets.DOCKER_USERNAME }}/sopo:latest
docker pull ${{ secrets.DOCKER_USERNAME }}/sopo:latest
sudo docker run -d --name alimo_redis_new redis:latest
docker run -d -p 80:8080 --name sopo ${{ secrets.DOCKER_USERNAME }}/sopo:latest
docker run -d -p 80:8080 --name sopo ${{ secrets.DOCKER_USERNAME }}/sopo:latest

0 comments on commit 46c737b

Please sign in to comment.