[Feat] 채팅 Config 클래스 #232
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD with Docker | |
on: | |
push: | |
branches: [ "dev" ] | |
pull_request: | |
branches: [ "dev" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-24.04-arm | |
# runner 찾기 : https://docs.github.com/ko/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build Docker image | |
run: docker build --platform linux/arm64 -t unsemawang . | |
- name: Verify Docker images | |
run: docker images | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 # https://github.com/docker/login-action | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Tag and Push Docker image | |
run: | | |
docker tag unsemawang nardis0321/kdev3:latest | |
docker push nardis0321/kdev3 | |
deploy: | |
runs-on: ubuntu-24.04-arm | |
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 |