Skip to content

Commit

Permalink
๐Ÿ’š [Release] workflow ๋นŒ๋“œ์™€ ๋ฐฐํฌ job ๋ถ„๋ฆฌ (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimhan-nah authored Jul 23, 2024
1 parent bfd056f commit c986cba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

name: Deploy

on:
workflow_dispatch:

jobs:
deploy-to-ec2:
runs-on: ubuntu-latest

steps:
- name: Deploy to Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
envs: GITHUB_SHA
script: |
sudo docker-compose -f ~/docker-compose.yml down && \
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/ghostserver:latest && \
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/ghostclient:latest && \
sudo docker-compose -f ~/docker-compose.yml up -d --build
sudo docker image prune -f
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,4 @@ jobs:
VITE_API_URL=${{ secrets.VITE_BASE_URL }}/api/v1
VITE_ASSET_URL=${{ secrets.VITE_BASE_URL }}
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/ghostclient:latest

deploy-to-ec2:
runs-on: ubuntu-latest
needs: build-and-push

steps:
- name: Deploy to Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
envs: GITHUB_SHA
script: |
sudo docker ps
sudo docker compose -f ~/docker-compose.yml down && \
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/ghostserver:latest && \
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/ghostclient:latest && \
sudo docker compose -f ~/docker-compose.yml up -d
sudo docker image prune -f
tags: ${{ secrets.DOCKER_USERNAME }}/ghostclient:latest

0 comments on commit c986cba

Please sign in to comment.