Skip to content

[Feat] 댓글 조회 기능 #90 #57

[Feat] 댓글 조회 기능 #90

[Feat] 댓글 조회 기능 #90 #57

Workflow file for this run

name: CI/CD with Docker
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker image
run: docker build --platform linux/amd64 -t unsemawang .
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Tag and Push Docker image
if: github.event_name == 'push'
run: |
docker tag unsemawang nardis0321/kdev3:latest
docker push nardis0321/kdev3
deploy:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push'
steps:
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
- name: SSH into EC2 and deploy Docker container
run: |
ssh -o StrictHostKeyChecking=no ubuntu@${{ secrets.EC2_PUBLIC_IP }} << 'EOF'
sudo docker pull nardis0321/kdev3
sudo docker-compose down || true
sudo docker-compose up -d
EOF