Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Minn-Choi authored Nov 6, 2024
1 parent 878002a commit fe9335f
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,31 @@ jobs:
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/my-vue-app:latest
deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Test SSH Connection
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_KEY }}
port: 22
script: |
echo "SSH connection successful!"
- name: Deploy to EC2
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_KEY }}
port: 22
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/my-vue-app:latest
docker stop my-vue-app || true
docker rm my-vue-app || true
docker run -d -p 80:80 --name my-vue-app ${{ secrets.DOCKER_USERNAME }}/my-vue-app:latest
# deploy ์„น์…˜์„ ์‚ญ์ œํ•˜๊ฑฐ๋‚˜ ์ฃผ์„ ์ฒ˜๋ฆฌํ•˜์—ฌ EC2 ๋ฐฐํฌ๋ฅผ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค.
# deploy:
# needs: build
# runs-on: ubuntu-latest

# steps:
# - name: Test SSH Connection
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.EC2_HOST }}
# username: ${{ secrets.EC2_USER }}
# key: ${{ secrets.EC2_KEY }}
# port: 22
# script: |
# echo "SSH connection successful!"

# - name: Deploy to EC2
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.EC2_HOST }}
# username: ${{ secrets.EC2_USER }}
# key: ${{ secrets.EC2_KEY }}
# port: 22
# script: |
# docker pull ${{ secrets.DOCKER_USERNAME }}/my-vue-app:latest
# docker stop my-vue-app || true
# docker rm my-vue-app || true
# docker run -d -p 80:80 --name my-vue-app ${{ secrets.DOCKER_USERNAME }}/my-vue-app:latest

0 comments on commit fe9335f

Please sign in to comment.